Professional Documents
Culture Documents
Good Logic, If Then
Good Logic, If Then
A A
AB A V B
______ ----------
B B
AB if A then B
BA B if A
f(a,b).
m(b,k).
f(a,r).
f(r,s).
m(s,l).
f(a,w).
f(w,g).
gf(X,Z) :- f(X,Y), m(Y,Z).
pgf1(X,Z) :- f(X,Y),
write(X), write(' is grandpa through mother '),
write(Y), nl,
m(Y,Z).
pgf1(X,Z) :- f(X,Y),
write(X), write(' is grandpa through father '),
write(Y), nl,
f(Y,Z).
5. Quantifiers
( X)(A(X)) for all X, A(X)
For any X, A(X)
Universal Quantifier
( X)(A(X)) there is, at least, one X such that A(X)
[There exist an X such that] A(X)
Existential Quantifier
Connectives: , &, V,