Mercurial > hg > Applications > Lite
comparison diag.pl @ 20:07d6c4c5654b iso-prolog
SICStus v4 (ISO prolog syntax)
author | kono |
---|---|
date | Thu, 30 Aug 2007 14:16:36 +0900 |
parents | e1d3145cff7a |
children | 29cf617f49db |
comparison
equal
deleted
inserted
replaced
19:e1d3145cff7a | 20:07d6c4c5654b |
---|---|
161 ord(not(X),Y) :- !,X @> Y. | 161 ord(not(X),Y) :- !,X @> Y. |
162 ord(X,Y) :- !,X @> Y. | 162 ord(X,Y) :- !,X @> Y. |
163 | 163 |
164 rev([],X,X). | 164 rev([],X,X). |
165 rev([H|T],X,Y) :- rev(T,[H|X],Y). | 165 rev([H|T],X,Y) :- rev(T,[H|X],Y). |
166 | |
167 member(H,[H|_]). | |
168 member(H,[_|T]):-member(H,T). | |
169 | 166 |
170 not_member(_,[]):-!. | 167 not_member(_,[]):-!. |
171 not_member(H,[H|_]):-!,fail. | 168 not_member(H,[H|_]):-!,fail. |
172 not_member(H,[_|T]):-not_member(H,T). | 169 not_member(H,[_|T]):-not_member(H,T). |
173 | 170 |