Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

First Order Predicate Calculus

1. C1, C2, ……. Ck,…. Constant symbols


Pi = 3.145678
2. x1, x2, ……… ,Xk, …. Variable symbols (place holder)
Terms = Constants+Variables
3. Function symbols
Father(p) = p1
Abou: human  male-human

!5\ ##2 $@#4


4. Predicates == Boolean functions
P11, p12, ………. 1-place predicate symbols
P21, p22, ………. 2-place predicate symbols
Pk1, pk2, ……….

Table(T), Block(a), Block(b), Block(c), Block(d), Block(e)


Ontop(a,T), Ontop(c, T), On(d,T)
Clear(c)
Ontop(b,a), ontop(e,d)

A A
AB A V B
______ ----------
B B
AB if A then B
BA 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).

gf(X,Z) :- f(X,Y), f(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).

(X,Y,Z)(father(X,Y) & mother(Y,Z)  grandfather(X,Z))


Grandfather(X,Z)  father(X,Y), mother(Y,Z),
(X,Y,Z)(father(X,Y) & father(Y,Z)  grandfather(X,Z))
Grandfather(X,Z)  father(X,Y), father(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, 

You might also like