If then

Description

If-then-else statement

Source: The Art of Prolog

Download

Program source code: if_then.pl

Listing

/*
   if_then_else(P,Q,R) :- Either P and Q, or not P and R.
*/
     if_then_else(P,Q,R) :- P, !, Q.
     if_then_else(P,Q,R) :- R.
 
%   Program 11.10    If-then-else statement

Comments

pl/prolog/pllib/if_then.txt · ostatnio zmienione: 2017/07/17 08:08 (edycja zewnętrzna)
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0