Using <tt>and</tt>


next up previous
Next: A ski-resort advisor (PPAI)
Up: A geographical knowledge base (PP)
Previous: Some questions
Back: to main list of student notes

Using and

Can you ask questions to find out:

There is another fact in this knowledge base, called flows_to. This is defined as follows:

The idea it expresses is that river X flows to river or sea Y if the water from X flows directly or indirectly to Y. Try the question flows_to(X,Y). and compare it with the results from linked_to(X,Y)..

Translate the definition into good English (using pronouns instead of variables). Why do you think it works? flows_to is your first example of a technique, very common in logic programming, called recursion, where something is defined in terms of itself. If you have studied grammars in linguistics, or programmed in high-level languages before, you may have encountered it already. We shall see several more examples.


next up previous
Next: A ski-resort advisor (PPAI)
Up: A geographical knowledge base (PP)
Previous: Some questions
Back: to main list of student notes



Jocelyn Paine
Tue Jun 4 17:40:31 BST 1996