Simple Facts (Cont.)


Examples of Simple Facts (Cont.)
We can interrogate this database of facts, by again posing a query, e.g.,
   ?- john_Forgot_His_Raincoat.

yes
?- raining.
yes
?- foggy.
no
The first two queries succeed since they can be matched against facts in the database in the previous slide. However, foggy fails (since it cannot be matches) and Prolog answers no since we have not told it this fact.

Simple Fact Exercises
Which of the following are syntactically correct facts:

Hazlenuts.

tomsRedCar.
2Ideas.
Prolog.

Given the database below, study the queries below it.
   blue_box.
   red_box.             
   green_circle.
   blue_circle.         
   orange_triangle.

?- green_circle.

?- circle_green.
?- red_triangle.
?- red_box.
?- orange_Triangle.