360 likes | 506 Views
Artificial Intelligence Logic. L. Manevitz. Logic - Advantages. Pretty universal (need to choose the correct language). Clear semantics Interpretation. Intended Interpretation. Uniform Method of Manipulating Theorem proving via Resolution. Green’s Trick for answer production.
E N D
Artificial IntelligenceLogic L. Manevitz L. Manevitz Lecture 4
Logic - Advantages • Pretty universal • (need to choose the correct language). • Clear semantics • Interpretation. • Intended Interpretation. • Uniform Method of Manipulating • Theorem proving via Resolution. • Green’s Trick for answer production. L. Manevitz Lecture 4
Representing Information Actual World Actual World Semantic connection Representation Interpretation Formal connection Formulas Formulas L. Manevitz Lecture 4
Basic Concept Let G be a set of formulas. Let φ be a specific formula. When does φ logically follow from G ? Meaning : in every possible interpretation where G is true then φ is true. Notationally :G φ (G “semantically implies φ). L. Manevitz Lecture 4
Syntax • Language: • Logical symbols. • Relation symbols. • Function symbols. • Constant symbols. • Terms – recursive. • Formulas – recursive. • Sentences – no free variables. L. Manevitz Lecture 4
Semantics - Interpretation θ θ θ θ θ θ θ θ θ θ= <A|R1,R2,..,Ri,F1,F2,..,Fk,C1,C2,..,Cl> Ri AxAx..xA Fk : AxAx..xA A Cl A θ θ θ L. Manevitz Lecture 4
Semantics • To handle variables, we extend the notion of satisfaction to include variables (explain on blackboard) L. Manevitz Lecture 4
How to work with • Basic semantic equivalents : • (e.g. De Morgan’s Laws, Assoc. Laws, Distr. Laws). • Fundamental Problem : • Find mechanical procedure to test if G φ or not. L. Manevitz Lecture 4
Abstraction of Proof - G φ • Intuitive: φ1 φ2 φn = φ • Example: “Acceptable Rule” φ ψ (MP) Where φiG or φi follows from {φj | j<i} By “acceptable” rule φ ψ L. Manevitz Lecture 4
Definitions • A system S is consistent if whenever G φ then G φ. • A system S is complete if whenever G φ then G φ. s s L. Manevitz Lecture 4
Theorem • Completeness Theorem: There is a system S s.t. G φ G φ L. Manevitz Lecture 4
G A A B A B Example • Trivially complete where A is any formula. • Sound Rule: (MP) L. Manevitz Lecture 4
A B A B Example cont. [M | s] A B iff [M | s] A or [M | s] B by def. If [M | s] A then [M | s] A by def. It follows that [M | s] B. L. Manevitz Lecture 4
What kind of systems ? • Mimic People (“Natural Deduction”). • Mimic Mathematical Proof. • Convenient for Computers. L. Manevitz Lecture 4
Proof Systems “Natural Deduction” Formal Computational e.g. Resolution Completeness Theorem L. Manevitz Lecture 4
What rule to apply to what ? Control Rules of Deduction DATA Set of formulas L. Manevitz Lecture 4
Resolution System (Syntax)Sound Rule • Basic Idea: (φ1 … φn) ( φ1 ψ1 … ψm) φ2 … φn ψ1 … ψm L. Manevitz Lecture 4
Semantic Equivalents • We can check this, now that we have a definition of truth in interpretations. • Example ~(~p) is equivalent to p L. Manevitz Lecture 4
Semantic Equivalents • ( A) A • A B A B • A B B A • A B (A B) (B A) • Associative : • A (B C) (A B) C • A (B C) (A B) C L. Manevitz Lecture 4
Semantic Equivalents cont. • Commutative: • A B B A • A B B A • Distributive: • A (B C) (A B) (A C) • A (B C) (A B) (A C) L. Manevitz Lecture 4
Semantic Equivalents cont. • De Morgan: • (A B) ( A) ( B) • (A B) ( A) ( B) L. Manevitz Lecture 4
Quantifier Equivalences • De Morgan: • (( x)A(x)) ( x) A(x) • (( x)A(x)) ( x) A(x) • x A(x) y A(y) • x A(x) y A(y) • x [P(x) Q(x)] ( x P(x)) ( x Q(x)) • x [P(x) Q(x)] ( x P(x)) ( x Q(x)) L. Manevitz Lecture 4
Resolution (Predicate)G S • Convert G to set of clauses. • Convert S to set of clauses. • Let Clauses := all the above clauses. • Repeat until NIL found : • Select two clauses. • Resolve (using Unification). • Check result : • If result is NIL finish. • Otherwise add result to Clauses L. Manevitz Lecture 4
Over all Procedure • Eliminate , . • Push to atomic. • Eliminate . • Rename variables in a formula. • Move quantifier to the left. L. Manevitz Lecture 4
Over all Procedure • Push down. • Eliminate conj. - By making separate formulas. • Rename variables in all formulas. • Eliminate - Convention. L. Manevitz Lecture 4
Example • [ x (A(x) B(x)] [ y C(y)] • [ x (A(x) B(x)] [ y C(y)] • [ x (A(x) B(x)] [ y C(y)] • [ x ( A(x) B(x)] [ y C(y)] • A(a) B(a) y C(y) • y [ A(a) B(a) C(y)] • Get Clause [ A(a) B(a) C(y)] To replace add a constant to language. L. Manevitz Lecture 4
- Elimination example • x y Boss (y,x) • Problem: • Constant not sufficient. • y depends on x. • Solution: • Add a new function symbol f(). • x Boss (f(x),x) L. Manevitz Lecture 4
Example Eliminate • x [Brick(x) [ y[On(x,y) Pyramid(y)] y[On(x,y) On(y,x)] y[ Brick(y) Equal(x,y)]]] • x [ Brick(x) [ y[On(x,y) Pyramid(y)] y[On(x,y) On(y,x)] y[ ( Brick(y)) Equal(x,y)]]] Push L. Manevitz Lecture 4
Example cont. Eliminate • x [ Brick(x) [ y[On(x,y) Pyramid(y)] y[ On(x,y) On(y,x)] y[Brick(y) Equal(x,y)]]] • x [ Brick(x) [[On(x,support(x)) Pyramid(support(x))] y[ On(x,y) On(y,x)] y[Brick(y) Equal(x,y)]]] Rename variables apart L. Manevitz Lecture 4
Example cont. Move to left • x [ Brick(x) [[On(x,support(x)) Pyramid(support(x))] y[ On(x,y) On(y,x)] z[Brick(z) Equal(x,z)]]] • x y z [ Brick(x) [[On(x,support(x)) Pyramid(support(x))] [ On(x,y) On(y,x)] [Brick(z) Equal(x,z)]]] Push down L. Manevitz Lecture 4
Example cont. • x y z [ Brick(x) [On(x,support(x)) Pyramid(support(x))]] [ Brick(x) On(x,y) On(y,x)] [ Brick(x) Brick(z) Equal(x,z)]] L. Manevitz Lecture 4
Example cont. • x y z [[ Brick(x) On(x,support(x))] [ Brick(x) Pyramid(support(x))] [ Brick(x) On(x,y) On(y,x)] [ Brick(x) Brick(z) Equal(x,z)]] Eliminate conj. L. Manevitz Lecture 4
Example cont. • x [ Brick(x) On(x,support(x))] x [ Brick(x) Pyramid(support(x))] x y [ Brick(x) On(x,y) On(y,x)] x z [ Brick(x) Brick(z) Equal(x,z)] Rename variables L. Manevitz Lecture 4
Example cont. • x [ Brick(x) On(x,support(x))] w [ Brick(w) Pyramid(support(w))] u y [ Brick(u) On(u,y) On(y,u)] v z [ Brick(v) Brick(z) Equal(v,z)] Eliminate L. Manevitz Lecture 4
Example cont. • Clause form: Brick(x) On(x,support(x)) Brick(w) Pyramid(support(w)) Brick(u) On(u,y) On(y,u) Brick(v) Brick(z) Equal(v,z) L. Manevitz Lecture 4