Slide 14.14: Using Prolog Slide 14.16: Simple facts (cont.) Home |
sunny.
We can now ask a query of Prolog by asking
?- sunny.
?-
is the Prolog prompt.
To this query, Prolog will answer yes
.
sunny
is true because (from above) Prolog matches it in its database of facts.
Facts have some simple rules of syntax:
john_is_cold. /* john is cold */These describe a particular set of circumstances for some character
raining. /* it is raining */
john_Forgot_His_Raincoat. /* john forgot his raincoat */
fred_lost_his_car_keys. /* fred lost is car keys */
peter_footballer. /* peter plays football */
john
.