We will use knowledge base 1 (kb1.pl) to demonstrate working with variables. Remember that, name of the variable starts with a capital letter. For example, if we want to know who all the students are, then we can write, student(X).

In the result, names of the students will be displayed one by one. Press the Enter key or semicolon (;). While pressing Enter key will just display a single result, pressing a semi-colon will display the next result. Look at the figure to understand this concept.

images

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *