Clauses displaying

Description

Showing all clause which define predicate

Source: PROLOG str. 101 Wydawnictwo PLJ Warszawa 1991 ISBN 83-85190-63-5

Download

Program source code: clauses_displaying.pl

Listing

dlugosc([], 0).
dlugosc([H|T], L) :- dlugosc(T, Y), L is Y + 1.
 
list1(X) :- clause(X, Y), klauzula(X, Y), write('.'), nl, fail.
list1(X).
 
klauzula(X, true) :- !, write(X).
klauzula(X, Y) :- write(X), write(' :- '), write(Y).
 
test :- list1(dlugosc(_, _)).

Comments

pl/prolog/pllib/clauses_displaying.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