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.
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.
New! Save questions or answers and organize your favorite content. Learn more.
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With