Slide 1 Propositional Definite Clause Logic: Syntax, Semantics and Bottom-up Proofs Jim Little UBC CS 322 – CSP October 20, 2014.

Slides:



Advertisements
Similar presentations
Completeness and Expressiveness
Advertisements

Computer Science CPSC 322 Lecture 25 Top Down Proof Procedure (Ch 5.2.2)
UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
1 Logic Logic in general is a subfield of philosophy and its development is credited to ancient Greeks. Symbolic or mathematical logic is used in AI. In.
Agents That Reason Logically Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 7 Spring 2004.
Propositional Logic Reading: C , C Logic: Outline Propositional Logic Inference in Propositional Logic First-order logic.
Logic CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Logic.
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Mar, 4, 2015 Slide credit: some slides adapted from Stuart.
CPSC 322, Lecture 21Slide 1 Bottom Up: Soundness and Completeness Computer Science cpsc322, Lecture 21 (Textbook Chpt 5.2) February, 27, 2009.
CPSC 322, Lecture 23Slide 1 Logic: TD as search, Datalog (variables) Computer Science cpsc322, Lecture 23 (Textbook Chpt 5.2 & some basic concepts from.
CPSC 322, Lecture 19Slide 1 Propositional Logic Intro, Syntax Computer Science cpsc322, Lecture 19 (Textbook Chpt ) February, 23, 2009.
Proof methods Proof methods divide into (roughly) two kinds: –Application of inference rules Legitimate (sound) generation of new sentences from old Proof.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
CPSC 322, Lecture 20Slide 1 Propositional Definite Clause Logic: Syntax, Semantics and Bottom-up Proofs Computer Science cpsc322, Lecture 20 (Textbook.
CPSC 322 Introduction to Artificial Intelligence September 20, 2004.
CPSC 322, Lecture 23Slide 1 Logic: TD as search, Datalog (variables) Computer Science cpsc322, Lecture 23 (Textbook Chpt 5.2 & some basic concepts from.
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Lecture 9 Jim Martin.
CPSC 322, Lecture 21Slide 1 Bottom Up: Soundness and Completeness Computer Science cpsc322, Lecture 21 (Textbook Chpt 5.2) March, 5, 2010.
Knoweldge Representation & Reasoning
CPSC 322, Lecture 22Slide 1 Logic: Domain Modeling /Proofs + Top-Down Proofs Computer Science cpsc322, Lecture 22 (Textbook Chpt 5.2) March, 8, 2010.
Slide 1 Logic: Domain Modeling /Proofs + Top-Down Proofs Jim Little UBC CS 322 – CSP October 22, 2014.
Computer Science CPSC 502 Lecture 6 Finish Planning Start Logic (Ch 5)
CPSC 322, Lecture 22Slide 1 Logic: Domain Modeling /Proofs + Top-Down Proofs Computer Science cpsc322, Lecture 22 (Textbook Chpt 5.2) Oct, 26, 2010.
1 Knowledge Based Systems (CM0377) Lecture 4 (Last modified 5th February 2001)
Pattern-directed inference systems
Advanced Topics in Propositional Logic Chapter 17 Language, Proof and Logic.
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Logical Agents Logic Propositional Logic Summary
Of 33 lecture 12: propositional logic – part I. of 33 propositions and connectives … two-valued logic – every sentence is either true or false some sentences.
Logic: Intro & Propositional Definite Clause Logic CPSC 322 – Logic 1 Textbook §5.1 March 4, 2011.
Propositional Logic Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma Guadalajara
CPSC 322, Lecture 23Slide 1 Logic: TD as search, Datalog (variables) Computer Science cpsc322, Lecture 23 (Textbook Chpt 5.2 & some basic concepts from.
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
A Logic of Partially Satisfied Constraints Nic Wilson Cork Constraint Computation Centre Computer Science, UCC.
CS6133 Software Specification and Verification
CPSC 322, Lecture 19Slide 1 (finish Planning) Propositional Logic Intro, Syntax Computer Science cpsc322, Lecture 19 (Textbook Chpt – 5.2) Oct,
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Oct, 30, 2015 Slide credit: some slides adapted from Stuart.
Computer Science CPSC 322 Lecture 22 Logical Consequences, Proof Procedures (Ch 5.2.2)
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
11 Artificial Intelligence CS 165A Thursday, October 25, 2007  Knowledge and reasoning (Ch 7) Propositional logic 1.
Slide 1 Propositional Logic Intro, Syntax Jim Little UBC CS 322 – CSP October 17, 2014 Textbook § – 5.2.
Logic: Proof procedures, soundness and correctness CPSC 322 – Logic 2 Textbook §5.2 March 7, 2011.
Propositional Logic Rather than jumping right into FOL, we begin with propositional logic A logic involves: §Language (with a syntax) §Semantics §Proof.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Proof Methods for Propositional Logic CIS 391 – Intro to Artificial Intelligence.
Foundations of Discrete Mathematics Chapter 1 By Dr. Dalia M. Gil, Ph.D.
Knowledge Repn. & Reasoning Lecture #9: Propositional Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2005.
1 Section 7.1 First-Order Predicate Calculus Predicate calculus studies the internal structure of sentences where subjects are applied to predicates existentially.
Computer Science CPSC 322 Lecture 14 Intro to Logic (5.1, 5.1.1) 1.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
CPSC 322, Lecture 22Slide 1 Logic: Domain Modeling /Proofs + Top-Down Proofs Computer Science cpsc322, Lecture 22 (Textbook Chpt 5.2) Oct, 30, 2013.
Computer Science cpsc322, Lecture 20
Knowledge and reasoning – second part
Propositional Logic Intro, Syntax Computer Science cpsc322, Lecture 19
Propositional Logic Intro, Syntax Computer Science cpsc322, Lecture 19
Propositional Definite Clause Logic: Syntax, Semantics, R&R and Proofs
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 20
Logic: Top-down proof procedure and Datalog
Assignment-2 due now Enterprise Architecture Conference Sat. Oct 27
Knowledge and reasoning – second part
Back to “Serious” Topics…
Logic: Domain Modeling /Proofs + Computer Science cpsc322, Lecture 22
Computer Science cpsc322, Lecture 20
Bottom Up: Soundness and Completeness
Bottom Up: Soundness and Completeness
Propositional Logic CMSC 471 Chapter , 7.7 and Chuck Dyer
ece 720 intelligent web: ontology and beyond
Representations & Reasoning Systems (RRS) (2.2)
Bottom Up: Soundness and Completeness
Presentation transcript:

Slide 1 Propositional Definite Clause Logic: Syntax, Semantics and Bottom-up Proofs Jim Little UBC CS 322 – CSP October 20, 2014

Slide 2 Lecture Overview Recap: Logic intro Propositional Definite Clause Logic: Semantics PDCL: Bottom-up Proof

Logic: A general framework for reasoning General problem: Query answering tell the computer how the world works tell the computer some facts about the world ask a yes/no question about whether other facts must be true Solving it with Logic 1.Begin with a task domain. 2.Distinguish those things you want to talk about (the ontology) 3.Choose symbols in the computer to denote elements of your ontologyChoose 4.Tell the system knowledge about the domainTell 5.Ask the system whether new statements about the domain are true or false live_w 4 ? lit_l 2 ? Slide 3

Example: Electrical Circuit / up /down Slide 4

/ up /down Syntax: are these sentences that a reasoning procedure can process? Semantics: what do these statements say about the world I need to represent? Slide 5

To Define a Logic We Need Syntax: specifies the symbols used, and how they can be combined to form legal sentences Knowledge base is a set of sentences in the language Semantics: specifies the meaning of symbols and sentences Reasoning theory or proof procedure: a specification of how an answer can be produced. Sound: only generates correct answers with respect to the semantics Complete: Guaranteed to find an answer if it exists Slide 6

Propositional Definite Clauses: Syntax Definition (atom) An atom is a symbol starting with a lower case letter Definition (body) A body is an atom or is of the form b 1 ∧ b 2 where b 1 and b 2 are bodies. Definition (definite clause) A definite clause is - an atom or - a rule of the form h ← b where h is an atom (“head”) and b is a body. (Read this as “h if b”.) Definition (KB) A knowledge base (KB) is a set of definite clauses Examples: p 1 ; live_l 1 Examples: p 1 ∧ p 2 ; ok_w 1 ∧ live_w 0 Examples: p 1 ← p 2 ; live_w 0 ← live_w 1 ∧ up_s 2 Slide 7

Propositional Definite Clauses: Semantics Definition (model) A model of a knowledge base KB is an interpretation in which KB is true. Similar to CSPs: a model of a set of clauses is an interpretation that makes all of the clauses true Definition (interpretation) An interpretation I assigns a truth value to each atom. Definition (truth values of statements) A body b 1 ∧ b 2 is true in I if and only if b 1 is true in I and b 2 is true in I. A rule h ← b is false in I if and only if b is true in I and h is false in I. A knowledge base KB is true in I if and only if every clause in KB is true in I. Slide 8

To Obtain This We Need One More Definition Definition (logical consequence) If KB is a set of clauses and G is a conjunction of atoms, G is a logical consequence of KB, written KB ⊧ G, if G is true in every model of KB. we also say that G logically follows from KB, or that KB entails G. In other words, KB ⊧ G if there is no interpretation in which KB is true and G is false. when KB is TRUE, then G must be TRUE We want a reasoning procedure that can find all and only the logical consequences of a knowledge base Slide 9

User’s View of Semantics Choose a task domain: intended interpretation. For each proposition you want to represent, associate a proposition symbol in the language. Tell the system clauses that are true in the intended interpretation: axiomatize the domain. Ask questions about the intended interpretation. If KB |= g, then g must be true in the intended interpretation. Slide 10

Computer’s View of Semantics The computer doesn’t have access to the intended interpretation. All it knows is the knowledge base. The computer can determine if a formula is a logical consequence of KB. If KB |= g then g must be true in the intended interpretation. Otherwise, there is a model of KB in which g is false. This could be the intended interpretation. The computer wouldn't know! Slide 11

Computer’s View of Semantics Otherwise, there is a model of KB in which g is false. This could be the intended interpretation. The computer wouldn't know pqrs I1I1 true I2I2 false Slide 12

To Define a Logic We Need Syntax: specifies the symbols used, and how they can be combined to form legal sentences Knowledge base is a set of sentences in the language Semantics: specifies the meaning of symbols and sentences Reasoning theory or proof procedure: a specification of how an answer can be produced ( sound and complete) Bottom-up Proof Procedure for Finding Logical Consequence Slide 13

Proof Procedures A proof procedure is a mechanically derivable demonstration that a formula logically follows from a knowledge base. Given a proof procedure P, KB ⊦ P g means g can be derived from knowledge base KB with the proof procedure. If I tell you I have a proof procedure for PDCL What do I need to show you in order for you to trust my procedure? That is sound and complete Slide 14

Soundness and Completeness Completeness of proof procedure P: need to prove that If g is true in all models of KB (KB ⊧ g) then g is derived by the procedure (KB ⊦ P g) Definition (completeness) A proof procedure P is complete if KB ⊧ g implies KB ⊦ P g. complete: every atom that logically follows from KB is derived by P Soundness of proof procedure P: need to prove that Definition (soundness) A proof procedure P is sound if KB ⊦ P g implies KB ⊧ g. If g can be derived by the procedure (KB ⊦ P g) then g is true in all models of KB (KB ⊧ g) sound: every atom derived by P follows logically from KB (i.e. is true in every model) Slide 15

Simple Proof Procedure problem with this approach? If there are n propositions in the KB, must check all the interpretations! Goal of proof theory find sound and complete proof procedures that allow us to prove that a logical formula follows from a KB avoiding to do the above Simple proof procedure S Enumerate all interpretations For each interpretation I, check whether it is a model of KB i.e., check whether all clauses in KB are true in I KB ⊦ S g if g holds in all such models Slide 16

Lecture Overview Recap Lecture 7 Logical Consequences and Proof Procedures Bottom-Up Proof Procedure Soundness Completeness Slide 17

Bottom-up proof procedure One rule of derivation, a generalized form of modus ponens: If “h ← b 1  …  b m " is a clause in the knowledge base, and each b i has been derived, then h can be derived. This rule also covers the case when m = 0. Slide 18

Bottom-up proof procedure C :={}; repeat select clause “h ← b 1 ∧ … ∧ b m ” in KB such that b i ∈ C for all i, and h ∉ C; C := C ∪ { h } until no more clauses can be selected. KB ⊦ G if G ⊆ C at the end of this procedure The C at the end of BU procedure is a fixed point: Further applications of our rule of derivation will not change C! Slide 19

C := {}; repeat select clause h ← b 1  …  b m in KB such that b i  C for all i, and h  C; C := C  {h} until no more clauses can be selected. Bottom-up proof procedure: example a ← b  c a ← e  f b ← f  k c ← e d ← k e. f ← j  e f ← c j ← c {} {e} {c,e} {c,e,f} {c,e,f,j} {c,e,f,j,a} Done. Slide 20

Lecture Overview Recap of Lecture 6 Planning as CSP Logic Intro Propositional Definite Clause Logic (PDCL) Sintax and Semantics Logical Consequences and Proof Procedures Bottom Up Proof Procedure Soundness and completeness Slide 21

Soundness of bottom-up proof procedure BU What do we need to prove to show that BU is sound ? sound: every atom g that P derives follows logically from KB Definition (soundness) A proof procedure P is sound if KB ⊦ P g implies KB ⊧ g. C := {}; repeat select clause h ← b 1  …  b m in KB such that b i  C for all i, and h  C; C := C  {h} until no more clauses can be selected. Slide 22

Soundness of bottom-up proof procedure BU What do we need to prove to show that BU is sound ? If g  C at the end of BU procedure, then g is true in all models of KB (KB ⊧ g) sound: every atom g that P derives follows logically from KB Definition (soundness) A proof procedure P is sound if KB ⊦ P g implies KB ⊧ g. C := {}; repeat select clause h ← b 1  …  b m in KB such that b i  C for all i, and h  C; C := C  {h} until no more clauses can be selected. Slide 23

Soundness of bottom-up proof procedure BU By contradiction: Suppose there is a g such that KB ⊦ BU g but not KB ⊧ g. If g  C at the end of BU procedure, then g is true in all models of KB (KB ⊧ g) What do we need to prove to show that BU is sound ? Let h be the first atom added to C that is not true in every model of KB. In particular, suppose I is a model of KB in which h isn’t true There must be a clause in KB of form h  b 1 ...  b n where each b i is true in I. Because h is false in I, this clause is false in I. Therefore I is not a model of KB => Contradiction Slide 24

Completeness of BU: general idea Generic completeness of proof procedure: If G is logically entailed by the KB (KB ⊧ G) then G can be proved by the BU procedure (KB ⊦ BU G) Sketch of our proof: 1.Suppose KB ⊧ G. Then G is true in all models of KB. 2.Thus G is true in any particular model of KB 3.We will define a model (called minimal model) so that if G is true in that model, G is proved by the bottom up algorithm. 4.Thus KB ⊦ G. Slide 25

We define a specific model of our KB, in which every atom in C at the end of BU is true every other atom is false This is called minimal model All atoms = {a, b, c, d,e, f, g} C = {e,d, c, f,} Minimal Model = a=F, b=F, c=T, d = T, e=T, f=T, g=F Using this model, we’ll then show that, if KB ⊧ G, then G must be in C, that is Completeness of BU: general idea If g is true in all models of KB (KB ⊧ g) then g  C at the end of BU procedure (KB ⊦ BU g) KB a ← e ∧ g. b ← f ∧ g. c ← e. f ← c e. d. Slide 26

Claim: MM is a model of KB Proof by contradiction: assume that MM is not a model of KB. Then there must exist some clause in KB which is false in MM Like every clause in KB, it is of the form h ← b 1  …  b m (with m  0). h ← b 1  …  b m can only be false in MM if each b i is true in MM and h is false in MM. Since each b i is true in MM, each b i must be in C as well. BU would add h to C, so h would be true in MM Contradiction! Thus, MM is a model of KB Definition The minimal model MM is the interpretation in which -every element of BU’s fixed point C is true -every other atom is false. Slide 27

Completeness of bottom-up procedure Direct proof based on minimal model: Suppose KB ⊧ g. Then g is true in all models of KB. Thus g is true in the minimal model. Thus g  C at the end of BU procedure. Thus KB ⊦ BU g. Done. KB ⊧ g implies KB ⊦ BU g If g is true in all models of KB (KB ⊧ g) then g  C at the end of BU procedure (KB ⊦ BU g) Slide 28

Summary for bottom-up proof procedure BU BU is sound: it derives only atoms that logically follow from KB BU is complete: it derives all atoms that logically follow from KB Together: it derives exactly the atoms that logically follow from KB And, it is efficient! Linear in the number of clauses in KB Each clause is used maximally once by BU Slide 29

Learning Goals Up To Here PDCL syntax & semantics - Verify whether a logical statement belongs to the language of propositional definite clauses - Verify whether an interpretation is a model of a PDCL KB. ‾Verify when a conjunction of atoms is a logical consequence of a knowledge base Bottom-up proof procedure Define/read/write/trace/debug the Bottom Up (BU) proof procedure Prove that the BU proof procedure is sound and complete Slide 30

Slide 31 Lecture Overview Recap: Logic intro Propositional Definite Clause Logic: Semantics PDCL: Bottom-up Proof

Slide 32 Next class (still section 5.2) Soundness and Completeness of Bottom-up Proof Procedure Using PDC Logic to model the electrical domain Reasoning in the electrical domain