[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
PrologIf
The example below shows that Bill likes an activity if Tom likes that activity.
The last line is equivalent to:
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
PrologIf
(Prolog) if, :-
if is used to infer conditions. Instead of typing if, you can use :-.The example below shows that Bill likes an activity if Tom likes that activity.
PREDICATES nondeterm likes(symbol, symbol) CLAUSES likes(tom,baseball). likes(tom,swimming). likes(bill, Activity) if likes(tom, Activity). GOAL likes(bill, What_Bill_likes).
The last line is equivalent to:
likes(bill, Activity) :- likes(tom, Activity).
'If' links
Code links
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
