Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Question mark, plus, minus preceding Prolog variable names

Tags:

People also ask

What does false mean in Prolog?

yes and no are returned after Edinburgh Prolog evaluates a query using its 'database' of facts and rules. yes means the result is provable from the facts and rules in the database; no means it's not provable from those rules and facts. true and false refer to the real world.

How do you set a variable in Prolog?

A variable in Prolog is a string of letters, digits, and underscores ( _ ) beginning either with a capital letter or with an underscore. Examples: X , Sister , _ , _thing , _y47 , First_name , Z2 The variable _ is used as a "don't-care" variable, when we don't mind what value the variable has.

Can you use a variable more than once in Prolog?

New! Save questions or answers and organize your favorite content. Learn more.

How do you print a variable in Prolog?

prolog - take as input and print the value of a variable. go:- write('Enter a name'),nl, read(Name),nl, print(Name).


I've searched for an explanation to this but haven't found one. What do the question mark, plus sign, and minus sign that sometimes precede variable names in the description of a Prolog predicate mean?

Example:

predicate(?Variable1,+Variable2,-Variable3)