Next Prev Up Top Contents Index

3.2.2.1 Example

(defrule link-exists :backward
  ((link-exists ?town1 ?town2)
 <--
  (or (link ?link town1 ?town1 town2 ?town2)
      (link ?link town2 ?town1 town1 ?town2))
  (cut))((link-exists ?town1 ?town2)
 <--
 (route-exists ?town1 ?town2)))

which says that a link exists between two towns either if there is a link object between them in the object base or if there is a route between the towns. The route-exists predicate would be defined by another backward chaining rule, or might be in the Prolog database.


LispWorks KnowledgeWorks and Prolog User Guide - 14 Dec 2001

Next Prev Up Top Contents Index