Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7781239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:09:49+00:00 2026-06-01T19:09:49+00:00

I am new to prolog programming and have been told in a tutorial to

  • 0

I am new to prolog programming and have been told in a tutorial to define a list of structures (in a script) so that I can query it as a database. However I find it impossible to define this list as a variable in a script. When I define a list such as

X=[a,b,c].

I just receive an error saying

No permission to modify static_procedure `(=)/2'

Does prolog not support defining variables such as this? I am using SWI-Prolog under linux.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T19:09:50+00:00Added an answer on June 1, 2026 at 7:09 pm

    In Prolog we speak of logical variables, to mean identity between literals.

    That is, a program it’s a set of rules that collectively state what’s true about our literals, and that literals are uninterpreted. We write rules using variables to describe relations about individuals, and while trying to prove if our query can become true, Prolog binds variables as rules dictate.

    A list it’s just syntax sugar for a binary relation between a term (the head) and (note the recursion here) a list. Usually, when we speak of a database, we use facts (rules without a body, always true) that binds atomic literals.

    So that tutorial probably expresses the task in different words than you report, or it’s somewhat misleading. You could anyway store lists in your database as such:

    mylist([a,b,c]).
    

    and write your program like:

    myprog(X) :- mylist(L), member(X, L).
    

    Then you can query your program like:

    ?- myprog(X).
    

    and Prolog, trying to prove myprog/1, attempt to prove mylist/1 and member/2…
    To prove mylist(L) the variable L get bound to [a,b,c].

    HTH

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to Prolog and I have so far learned how to define
I am new to Prolog and I'm trying to to create function that will
I'm new to prolog and I just can't figure this out. I'm trying to
I am new to Prolog. I need to write an integer adder that will
How do I write a procedure in Prolog that clears a list of integers
I'm new to Prolog and stuck on some programming homework. one of them should
I am new in Prolog and I am stucked in a problem. I have
I am new in Prolog and I was just thinking that why this rule
I'm new to Prolog. Using this basic 'database' structure, I thought I would be
(Pardon if my terminology is wrong... I'm new to Prolog.) Suppose you have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.