Whenever you run the Prolog interpreter, it will prompt you with ?. If it fails to prove the query true, it answers "No". If so, it answers "yes" and displays any variable bindings that it made in coming up with the answer. In making a query you are asking Prolog whether it can prove that your query is true. ![]() The database is assumed to represent what is true about a particular problem domain. Queries The Prolog interpreter responds to queries about the facts and rules represented in its database. * John does not like pizza */ likes(john,susie) :- likes(john,mary)./* John likes Susie if John likes Mary. * John likes Susie or John likes Mary */ not(likes(john,pizza)). * John likes everybody and everybody likes John */ likes(john, susie) likes(john,mary). ![]() * John likes everybody */ likes(john, Y), likes(Y, john). * Everyone likes Susie */ likes(john, Y). Note that all Prolog sentences must end with a period. Whenever a variable occurs in a Prolog expression, it is assumed to be universally quantified. ![]() AIM : 1)program in prolog to implement simple facts and queries? Source Code: FACTS: A fact is a predicate expression that makes a declarative statement about the problem domain.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |