Professional Documents
Culture Documents
Chapter objectives
By studying this chapter, you will:
Chapter plan
Next in this chapter, we will cover:
Symbolic A.I.
Calculations and reasoning.
System resolution by
predicates.
Symbolic A. I.
Part plan
In this part, we will cover:
Classical Logic:
Proposition: a decidable sentence.
Only two truth values, TRUE or FALSE
binary logic.
Principle of the no contradiction.
Reasoning by deduction.
syllogisms.
Conclusion: SM
SUPINFO International University http://www.supinfo.com
Symbolic AI
Valid conclusion:
Therefore, all the dogs are barking
????
The logic deals with the truth. It is independent of the content of the
statement.
For example:
"If (he drives fast) then (he will crash)"
This statement may be true or false (but if he is a good driver and he
masters his driving he will perhaps not have an accident).
On the other hand:
"If (he drives fast) then ((he will drive faster) or (he will slow down))"
This statement will always be true no matter what the circumstances.
Part plan
In this parts, we will cover:
Propositional calculus.
Predicate calculus.
Propositional calculus
Propositional calculus
Propositional calculus
Propositional calculus
Propositional calculus
Propositional calculus
Examples of formulas:
((a b) c ) , (a (FALSE b)).
Examples: these arent formulas:
(a b), (b b)
Propositional calculus
The order isnt total but partial and it is possible to represent the
proposals as a tree.
Examples:
((a b) c ) , (a (FALSE b)).
a b c FALSE b
Propositional calculus
The semantics:
A truth value (TRUE, FALSE) is given for each atomic
propositions, it is his valuation (or interpretation).
TRUE, FALSE are constants.
Notation of the formulas interpretation:
The valuation for the atom a is denoted by: v(a) or a.
The valuation for the formula A is denoted by: v(A) or A.
Propositional calculus
Propositional calculus
The satisfiability:
A formula is satisfiable (or consistent) if there is at least one
interpretation v that makes it true: v A.
a b is satisfiable.
Propositional calculus
The satisfiability:
A formula A which is true for any v interpretation is a tautology, it is
called universally valid. We can also say v(A) = TRUE (or A =
TRUE). A is a tautology if and only if it is satisfied by all
interpretations: F
(a b) a b : is a tautology.
Theorem: A formula A is valid if and only if its negation A is not-
satisfiable:
A is valid.
v(A) = TRUE, for all v interpretations.
v(A) = FALSE, for all v interpretations.
A is not-satisfiable.
SUPINFO International University http://www.supinfo.com
Calculations and reasoning
Propositional calculus
The satisfiability:
Some definitions:
Model:
The v interpretation is a model for the formula A if v A.
v is a model for an set of formulas Ai , 1 i n if i, v Ai
Logical consequence:
The formula A is logical consequence of the formula Z (Z
A) if for all v such as v Z then v A or if all model of Z is a
model of A.
Propositional calculus
The satisfiability:
Let A be a set of formulas and B a formula, A B if and only
if A B are not-satisfiable.
A1, . . . , An B if and only if (A1 An B) is valid.
Let B be a formula. If A is a set not-satisfiable of formulas,
then B is a logical consequence of A.
If B is a valid formula, then B is logical consequence of any
set of formulas.
Propositional calculus
The satisfiability:
Proof of A B if and only if A and B is not-satisfiable.
Per hypothesis: Lets assume that A and B are satisfiable. There
is a v interpretation so that.
v satisfies B : v( B) = TRUE and v(B)=FALSE. But v
satisfies A, so we also have v(B) = TRUE.
Per hypothesis: Lets assume that A and B not-satisfiable.
Lets have v A and prove that v(B)=TRUE. If v(B)=FALSE
then v( B)=TRUE. Therefore v satisfies A and B, but its not
allowed according to hypothesis, therefore v(B)=TRUE.
Propositional calculus
The satisfiability:
We have A and B two formulas.
A is logically equivalent to B if and only if A B or (A B
and B A).
A B can be written as: (A B) (B A)
A B can be written as: A V B
(A B) = A V B (law of De Morgan)
If A is valid, and if A is empty, B is logical consequence of A
if and only if B is valid. B or B.
Propositional calculus
The satisfiability:
We have A, B and F formulas.
A = A
A V (F B) = (A V F) (A V B) (distributivity of V on and
conversely).
A (F V B) = (A F) V (A B) (distributivity of V on and
conversely).
A FALSE means that A is not-satisfiable. Because for
any model of A to be a model of False, then the set A must
admit no model at all.
Propositional calculus
The satisfiability:
Proof of A F B if and only if A,F B
Per hypothesis: Let v be an interpretation: v A,F. Lets show that v
satisfies B.
v satisfies A therefore v satisfies F B, we have v(F)=TRUE
therefore v(F B)= TRUE = v(B)
Per reciprocal hypothesis (A, F B. show A F B): Let v be an
interpretation: v A. Lets show that v(F B) = TRUE.
If v(F)=TRUE then v satisfies A and F, therefore per
hypothesis v satisfies B. Therefore v(F B)=v(B)=TRUE
If v(F) = FALSE then v(F B) = TRUE
In both cases, we have v F B.
SUPINFO International University http://www.supinfo.com
Calculations and reasoning
Propositional calculus
The satisfiability:
A system of inference is correct if, for any rule of the system, the
conclusion is a logical consequence of its premise (the conjunction
of its premises) denoted*
A system of inference is complete if it is possible to prove any valid
formula:
A, A, then * A.
Propositional calculus
The satisfiability:
The formulas of the propositional calculus are inductive, which
means there is a principle of induction applicable:
If a property, true for any proposal, exists and we have the
formulas A and B, then the formulas A, (A B), (A B), (A
B) and (A B) are true.
Propositional calculus
The satisfiability:
Exercise:
A Logician listening to one of his friends evoke his passion for his
programming languages:
I love Lisp or I love Python.
If I love Lisp, then I love Python.
The logician may conclude that his friend loves Python. Why?
Propositional calculus
The satisfiability:
Exercise (answer):
Let a be the propositional: I love Lisp and b the propositional: I
love Python'. The propositional can be rewritten as:
I love Lisp or I love Python: a b
If I love Lisp then I love Python: a b
Propositional calculus
The satisfiability:
Exercise (answer):
Interpretations where the two propositionals are true:
v(a) = v(b) = TRUE
a b a b : v(a) = FALSE, v(b) = TRUE
In both cases, the truth value of b is TRUE.
Propositional calculus
Propositional calculus
Propositional calculus
R = He is a player Conjunction
S = He is French 1 R 2 S
T = He is English R&S
Simplification Addition
1 R & S 2 S
R S T
Propositional calculus
Propositional calculus
Demonstration (deductive):
P & (P F) F
F & (F C) C
C (C M)
F & (C M) F (C M)
Propositional calculus
Exercise
Premises:
(B C) A
B
Goal:
A B
Demonstration (deductive):
( B) B
B (B C)
(B C) & ((B C) A) A
A& B (A B)
SUPINFO International University http://www.supinfo.com
Calculations and reasoning
Propositional calculus
Exercise
Premises:
A B
B C
A D
Goal:
C
Demonstration (deductive):
( A D) A
(A B) & A B
B & (B C) C
Propositional calculus
a (b a)
a , (b a)
a,b a,a
Propositional calculus
a = TRUE , (b a) = FALSE
a b a a
a b a
a (b a)
Propositional calculus
The algorithm of proof is based on the refutation:
Let A be a set of formulas and C a Goal. To demonstrate A
C we must demonstrate that A and C are not-satisfiable,
that is: A, C
Propositional calculus
Propositional calculus
Propositional calculus
A refutation of A is a derivation by resolution of from the
hypotheses of A, therefore it can be depicted as a tree of refutation:
{a b c, a b c, b c , c} with c is the refutation of c.
b c c a b c a b c
b b c c
b
b c
c c
Propositional calculus
The satisfaction of elementary formulas can be made by
substitutions and simplifications.
For example:
Substitutions of atoms by constants: (a c) c
a = TRUE
(TRUE c) c
c c = always true
OR
a = FALSE
(FALSE c) c
FALSE c = always true
SUPINFO International University http://www.supinfo.com
Calculations and reasoning
Propositional calculus
Propositional calculus
Propositional calculus
Method for transforming a propositional formula into its conjunctive
normal form.
Example:
(a (b c )) (c d)
Simplification of :
(a (b c )) ((c d) ( d c))
a ((b c) ( c b)) ((c d) ( d c))
Simplification of :
a (( b c) (c b)) ((c d) ( d c))
a (( b c) (c b)) (( c d) (d c))
Propositional calculus
Predicate calculus
Predicate calculus
Example:
john goes to the sea goes(john, sea)
john goes to the sea or the mountains goes(john, sea) V
goes(john, mountains)
Predicate calculus
Predicate calculus
Predicate calculus
Predicate calculus
Predicate calculus
The satisfiability:
An interpretation is a function that manipulates the symbols of the
predicate through its field.
A formula is satisfiable if it is true for at least one interpretation in
a field.
( a)( male(a) female(a))
A formula is not-satisfiable if it is true for no interpretation in any
field.
( a)(P(a)) ( b)( P(b))
A formula is valid if it is true for all the interpretations in all the
fields.
(( a) P(a)) ( a) ( P(a))
SUPINFO International University http://www.supinfo.com
Calculations and reasoning
Predicate calculus
Predicate calculus
Predicate calculus
Predicate calculus
Predicate calculus
Example (continued):
Skolemization: Removal of existential quantifiers by elimination:
( p(F(a))) (( b) q(b))) ((p(F(c)) q(F(c))))
Removal of universal quantifiers:
( p(F(a)) q(b)) (p(F(c)) q(F(c)))
Distribution of operators and for a conjunctive normal form:
(( p(F(a)) q(b) (p(F(c))) (( p(F(a)) q(b) (q(F(c)))
Predicate calculus
Predicate calculus
Part plan
In this part, we will cover:
c b
a b c
a b
Table (t)
Table (t)
Y
X X Y
a b
b a c table(c)
c b on(b, c)
Table (t) c on(a, b)
on(a, b) on(b,c) table(c) free(a) Table (t)
b
a c table(c)
b on(b, c)
Trying to satisfy one of the goals
c on(a, b)
SUPINFO International University http://www.supinfo.com Table (t)
The resolution of a system by predicates
R3 R2
table(a)
table(a)
table(b)
b on(b, c)
table(c)
c on(c, a)
free(a)
a free(b) a c b free(b)
free(c)
R3
table(a) table(b)
table(c) table(c)
a b c b a
b c a c a b on(b, c) on(a, b)
a c free(a) b c free(a)
free(b) free(c)
R3
a table(c)
on(b, c) c
b on(a, b) a
Final state c free(a) b
SUPINFO International University http://www.supinfo.com
The resolution of a system by predicates
Intermediate state 2
a
c b
We apply R3, where x = b, y = c
Intermediate state 2
R3 sub-goals: free(b), free(c), stack(b,c)
R1 shows that b is not free, therefore:
R2: remove(a,b)
undo the previous action c b a
Intermediate state 4
We execute: stack(a,b)
a
b
c
Final state
Module Summary
Supplementary
... remain A.I. means to
interactive with = solutions:
its environment intelligent the heuristics
concepts
being intelligent:
The intelligent it is seeking
concepts do autonomy,
have their learning,
limits
Publications
End of module