Różnice

Różnice między wybraną wersją a wersją aktualną.

Odnośnik do tego porównania

pl:prolog:pllib:trees_proof [2019/06/27 15:50]
pl:prolog:pllib:trees_proof [2019/06/27 15:50] (aktualna)
Linia 1: Linia 1:
 +====== Trees proof ======
 +{{tag>​trees proof}}
 +===== Description =====
 +Generating proof trees.
 +
 +**Source**: ​ PROLOG programming for artificial intelligence,​ 3rd Edition, Harlow, 2001, ISBN 0-201-40375-7.
 +===== Download =====
 +Program source code: {{trees_proof.pl}}
 +===== Listing =====
 +<code prolog>
 +% Figure 15.8  Generating proof trees.
 +
 +% is_true( P, Proof) Proof is a proof that P is true
 +
 +:-  op( 800, xfx, <=).
 +:-  op( 800, fx, if).
 +:-  op( 700, xfx, then).
 +:-  op( 300, xfy, or).
 +:-  op( 200, xfy, and).
 +
 +is_true( P, P)  :-
 +   fact( P).
 +
 +is_true( P, P <= CondProof) ​ :-
 +   if Cond then P,
 +   ​is_true( Cond, CondProof).
 +
 +is_true( P1 and P2, Proof1 and Proof2) ​ :-
 +   ​is_true( P1, Proof1),
 +   ​is_true( P2, Proof2).
 +
 +is_true( P1 or P2, Proof) ​ :-
 +   ​is_true( P1, Proof)
 +   ;
 +   ​is_true( P2, Proof).
 +</​code>​
 +===== Comments =====
  
pl/prolog/pllib/trees_proof.txt · ostatnio zmienione: 2019/06/27 15:50 (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