
PROLOG does SO have NOT() !!
Posted:
Nov 20, 2012 3:39 AM


Exactly the same way we use not().
Failure to return a result can be programmed for ANY PREDICATE
*WITH A FINITE DOMAIN*
e.g. Boolean Predicates
if(X,Y) : true(X) , true(Y) if(X,Y) : not(X) , true(Y) if(X,Y) : not(X) , not(Y) not(if(X,Y)) : true(X) , not(Y)

A predicate with more than 2 values!
gender(m). 1 gender(f). 2 not(gender(X)). 3
Prolog searches for a match from top to bottom, it will return > gender(m)
or > not(gender(t)).
for any value other than m or f!
You can PROGRAM the predicate NOT(...)
for any predicate with a FINITE SET OF ARGUMENT VALUES!
Herc  www.microPROLOG.com
if( if(t(S),f(R)) , if(t(R),f(S)) ). if it's sunny then it's not raining ergo if it's raining then it's not sunny

