Ia Lect Lpoi Lect 4
Ia Lect Lpoi Lect 4
P
Q
P Q .
P Q
~ Q ~ P
P
P Q
Q
Example
Mihai has money
The car is white
The car is nice
If the car is white or the car is nice and Mihai
has money then Mihai goes to the mountain
B
A
F
(A v F) . B C
4. First order predicate logic
4.1 Syntax
Be D a domain of values. A term is defined as:
(1) A constant is a term with a fixed value
belonging to D.
(2) A variable is a term which may take values in
D.
(3) If f is a function of n arguments and t
1
,..t
n
are
terms then f(t
1
,..t
n
) is a term.
(4) All terms are generated by the application of
rules (1)(3).
Predicates of arity n
Atom or atomic formula.
Literal
A well formed formula (wff) in first order predicate logic is
defined as:
(1) A atom is an wff
(2) If P[x] is a wff then ~P[x] is an wff.
(3) If P[x] and Q [x] are wffs then P[x].Q[x],
P[x] vQ[x], PQ and PQ are wffs.
(4) If P[x] is an wff then x P[x], -x P[x] are wffs.
(5) The set of all wffs can be generated by repeatedly
applying rules (1)..(4).
Syntax PL - cont
Syntax - schematically
Constante Variabile Functii
a x f(x, a)
Termeni Predicate
P
Formule atomice
P(a, x)
Formule atomice negate
~P(a, x)
Literali Cuantificatori Conectori logici
-,
~, ., v,,
Formule bine formate
CNF, DNF
Conjunctive normal form (CNF)
F
1
. .F
n
,
F
i
, i=1,n
(L
i1
v vL
im
).
Disjunctive normal form (DNF)
F
1
v vF
n
,
F
i
, i=1,n
(L
i1
. .L
im
)
The interpretation of a formula F in first order
predicate logic consists of fixing a domain of
values (non empty) D and of an association of
values for every constant, function and predicate
in the formula F as follows:
(1) Every constant has an associated value in D.
(2) Every function f, of arity n, is defined by the
correspondence where
(3) Every predicate of arity n, is defined by the
correspondence
D D
n