Propositional Logic: Bottom-Up Proofs

Similar documents
Logic: Resolution Proofs; Datalog

Propositional Logic: Semantics and an Example

Logic: Bottom-up & Top-down proof procedures

Propositional Definite Clause Logic: Syntax, Semantics and Bottom-up Proofs

Logic: Top-down proof procedure and Datalog

Reasoning Under Uncertainty: Introduction to Probability

Propositions. c D. Poole and A. Mackworth 2008 Artificial Intelligence, Lecture 5.1, Page 1

Chapter 5: Propositions and Inference. c D. Poole, A. Mackworth 2010, W. Menzel 2015 Artificial Intelligence, Chapter 5, Page 1

Knowledge base (KB) = set of sentences in a formal language Declarative approach to building an agent (or other system):

Reasoning Under Uncertainty: Introduction to Probability

Propositions. c D. Poole and A. Mackworth 2010 Artificial Intelligence, Lecture 5.1, Page 1

Contents Chapters 2 & 3

Proof Methods for Propositional Logic

CSCI 5582 Artificial Intelligence. Today 9/28. Knowledge Representation. Lecture 9

Outline. Logical Agents. Logical Reasoning. Knowledge Representation. Logical reasoning Propositional Logic Wumpus World Inference

Chapters 2&3: A Representation and Reasoning System

Inference in Propositional Logic

Inf2D 13: Resolution-Based Inference

Outline. Logical Agents. Logical Reasoning. Knowledge Representation. Logical reasoning Propositional Logic Wumpus World Inference

Inference Methods In Propositional Logic

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

Propositional logic II.

Artificial Intelligence Chapter 7: Logical Agents

Inference Methods In Propositional Logic

Propositional Logic: Review

Intelligent Agents. Pınar Yolum Utrecht University

AI Programming CS S-09 Knowledge Representation

Logical Inference. Artificial Intelligence. Topic 12. Reading: Russell and Norvig, Chapter 7, Section 5

Propositional Logic: Methods of Proof (Part II)

CSC242: Intro to AI. Lecture 11. Tuesday, February 26, 13

Logic in AI Chapter 7. Mausam (Based on slides of Dan Weld, Stuart Russell, Subbarao Kambhampati, Dieter Fox, Henry Kautz )

Inference in first-order logic

Propositional Logic. Logic. Propositional Logic Syntax. Propositional Logic

Artificial Intelligence. Propositional logic

Deductive Systems. Lecture - 3

Warm-Up Problem. Write a Resolution Proof for. Res 1/32

Logical Agent & Propositional Logic

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning

Propositional Logic Part 1

Logical Agents (I) Instructor: Tsung-Che Chiang

Title: Logical Agents AIMA: Chapter 7 (Sections 7.4 and 7.5)

Logical Agents. Chapter 7

Artificial Intelligence

Chapter 4: Classical Propositional Semantics

Logic in AI Chapter 7. Mausam (Based on slides of Dan Weld, Stuart Russell, Dieter Fox, Henry Kautz )

Logic I - Session 22. Meta-theory for predicate logic

CS 380: ARTIFICIAL INTELLIGENCE

Advanced Topics in LP and FP

Logical Agent & Propositional Logic

a. See the textbook for examples of proving logical equivalence using truth tables. b. There is a real number x for which f (x) < 0. (x 1) 2 > 0.

CS 7180: Behavioral Modeling and Decision- making in AI

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Announcements. Assignment 5 due today Assignment 6 (smaller than others) available sometime today Midterm: 27 February.

Introduction to Intelligent Systems

Knowledge based Agents

Agents that reason logically

CS 380: ARTIFICIAL INTELLIGENCE PREDICATE LOGICS. Santiago Ontañón

Logic. Introduction to Artificial Intelligence CS/ECE 348 Lecture 11 September 27, 2001

Propositional Logic: Methods of Proof. Chapter 7, Part II

Inference in first-order logic

Propositional Logic: Methods of Proof (Part II)

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

Discrete Mathematics

Logical Agents. September 14, 2004

Overview. Knowledge-Based Agents. Introduction. COMP219: Artificial Intelligence. Lecture 19: Logic for KR

CS:4420 Artificial Intelligence

CSCI-495 Artificial Intelligence. Lecture 17

Logic: Intro & Propositional Definite Clause Logic

The Wumpus Game. Stench Gold. Start. Cao Hoang Tru CSE Faculty - HCMUT

Propositional Logic: Methods of Proof (Part II)

Artificial Intelligence

Logical Agents. Santa Clara University

The proposition p is called the hypothesis or antecedent. The proposition q is called the conclusion or consequence.

Introduction to Intelligent Systems

CS 2740 Knowledge Representation. Lecture 4. Propositional logic. CS 2740 Knowledge Representation. Administration

Reasoning Under Uncertainty: Conditional Probability

Revised by Hankui Zhuo, March 21, Logical agents. Chapter 7. Chapter 7 1

Class Assignment Strategies

Automated Reasoning Lecture 2: Propositional Logic and Natural Deduction

Logic. Knowledge Representation & Reasoning Mechanisms. Logic. Propositional Logic Predicate Logic (predicate Calculus) Automated Reasoning

Warm-Up Problem. Is the following true or false? 1/35

2. The Logic of Compound Statements Summary. Aaron Tan August 2017

Logical agents. Chapter 7. Chapter 7 1

Supplementary exercises in propositional logic

Description Logics. Deduction in Propositional Logic. franconi. Enrico Franconi

First Order Logic: Syntax and Semantics

7. Logical Agents. COMP9414/ 9814/ 3411: Artificial Intelligence. Outline. Knowledge base. Models and Planning. Russell & Norvig, Chapter 7.

CS 2710 Foundations of AI Lecture 12. Propositional logic. Logical inference problem

Logic: Propositional Logic Truth Tables

TDT4136 Logic and Reasoning Systems

Last update: March 4, Logical agents. CMSC 421: Chapter 7. CMSC 421: Chapter 7 1

Propositional Resolution Part 1. Short Review Professor Anita Wasilewska CSE 352 Artificial Intelligence

Reasoning Under Uncertainty: Variable Elimination

KB Agents and Propositional Logic

CS 730/830: Intro AI. 1 handout: slides. Wheeler Ruml (UNH) Lecture 11, CS / 15. Propositional Logic. First-Order Logic

Logical Agents. Outline

Logic and Inferences

Logical agents. Chapter 7. Chapter 7 1

First Order Logic: Syntax and Semantics

Transcription:

Propositional Logic: Bottom-Up Proofs CPSC 322 Logic 3 Textbook 5.2 Propositional Logic: Bottom-Up Proofs CPSC 322 Logic 3, Slide 1

Lecture Overview 1 Recap 2 Bottom-Up Proofs 3 Soundness of Bottom-Up Proofs 4 Completeness of Bottom-Up Proofs 5 Resolution Proofs Propositional Logic: Bottom-Up Proofs CPSC 322 Logic 3, Slide 2

Propositional Definite Clauses: Semantics Semantics allows you to relate the symbols in the logic to the domain you re trying to model. Definition (interpretation) An interpretation I assigns a truth value to each atom. We can use the interpretation to determine the truth value of clauses and knowledge bases: 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. Propositional Logic: Bottom-Up Proofs CPSC 322 Logic 3, Slide 3

Models and Logical Consequence Definition (model) A model of a set of clauses is an interpretation in which all the clauses are true. 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. Propositional Logic: Bottom-Up Proofs CPSC 322 Logic 3, Slide 4

Proofs A proof is a mechanically derivable demonstration that a formula logically follows from a knowledge base. Given a proof procedure, KB g means g can be derived from knowledge base KB. Recall KB = g means g is true in all models of KB. Definition (soundness) A proof procedure is sound if KB g implies KB = g. Definition (completeness) A proof procedure is complete if KB = g implies KB g. Propositional Logic: Bottom-Up Proofs CPSC 322 Logic 3, Slide 5

Lecture Overview 1 Recap 2 Bottom-Up Proofs 3 Soundness of Bottom-Up Proofs 4 Completeness of Bottom-Up Proofs 5 Resolution Proofs Propositional Logic: Bottom-Up Proofs CPSC 322 Logic 3, Slide 6

Bottom-up Ground 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. You are forward chaining on this clause. (This rule also covers the case when m = 0.) Propositional Logic: Bottom-Up Proofs CPSC 322 Logic 3, Slide 7

Bottom-up proof procedure KB g if g C at the end of this 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. Propositional Logic: Bottom-Up Proofs CPSC 322 Logic 3, Slide 8

Example a b c. a e f. b f k. c e. d k. e. f j e. f c. j c. Propositional Logic: Bottom-Up Proofs CPSC 322 Logic 3, Slide 9

Example a b c. a e f. b f k. c e. d k. e. f j e. f c. j c. {} Propositional Logic: Bottom-Up Proofs CPSC 322 Logic 3, Slide 9

Example a b c. a e f. b f k. c e. d k. e. f j e. f c. j c. {} {e} Propositional Logic: Bottom-Up Proofs CPSC 322 Logic 3, Slide 9

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} Propositional Logic: Bottom-Up Proofs CPSC 322 Logic 3, Slide 9

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} Propositional Logic: Bottom-Up Proofs CPSC 322 Logic 3, Slide 9

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} Propositional Logic: Bottom-Up Proofs CPSC 322 Logic 3, Slide 9

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} {a, c, e, f, j} Propositional Logic: Bottom-Up Proofs CPSC 322 Logic 3, Slide 9

Lecture Overview 1 Recap 2 Bottom-Up Proofs 3 Soundness of Bottom-Up Proofs 4 Completeness of Bottom-Up Proofs 5 Resolution Proofs Propositional Logic: Bottom-Up Proofs CPSC 322 Logic 3, Slide 10

Soundness of bottom-up proof procedure If KB g then KB = g. Suppose there is a g such that KB g and KB = g. Let h be the first atom added to C that s not true in every model of KB. In particular, suppose h isn t true in model I of KB. There must be a clause in KB of form h b 1... b m Each b i is true in I. h is false in I. So this clause is false in I. Therefore I isn t a model of KB. Contradiction: thus no such g exists. Propositional Logic: Bottom-Up Proofs CPSC 322 Logic 3, Slide 11

Lecture Overview 1 Recap 2 Bottom-Up Proofs 3 Soundness of Bottom-Up Proofs 4 Completeness of Bottom-Up Proofs 5 Resolution Proofs Propositional Logic: Bottom-Up Proofs CPSC 322 Logic 3, Slide 12

Minimal Model We can use proof procedure to find a model of KB. First, observe that the C generated at the end of the bottom-up algorithm is a fixed point. further applications of our rule of derivation will not change C. Propositional Logic: Bottom-Up Proofs CPSC 322 Logic 3, Slide 13

Minimal Model We can use proof procedure to find a model of KB. First, observe that the C generated at the end of the bottom-up algorithm is a fixed point. further applications of our rule of derivation will not change C. Definition (minimal model) Let the minimal model I be the interpretation in which every element of the fixed point C is true and every other atom is false. Propositional Logic: Bottom-Up Proofs CPSC 322 Logic 3, Slide 13

Minimal Model We can use proof procedure to find a model of KB. First, observe that the C generated at the end of the bottom-up algorithm is a fixed point. further applications of our rule of derivation will not change C. Definition (minimal model) Let the minimal model I be the interpretation in which every element of the fixed point C is true and every other atom is false. Claim: I is a model of KB. Proof: Assume that I is not a model of KB. Then there must exist some clause h b 1... b m in KB (having zero or more b i s) which is false in I. This can only occur when h is false and each b i is true in I. If each b i belonged to C, we would have added h to C as well. Since C is a fixed point, no such I can exist. Propositional Logic: Bottom-Up Proofs CPSC 322 Logic 3, Slide 13

Completeness If KB = g then KB g. Suppose KB = g. Then g is true in all models of KB. Thus g is true in the minimal model. Thus g is generated by the bottom up algorithm. Thus KB g. Propositional Logic: Bottom-Up Proofs CPSC 322 Logic 3, Slide 14

Lecture Overview 1 Recap 2 Bottom-Up Proofs 3 Soundness of Bottom-Up Proofs 4 Completeness of Bottom-Up Proofs 5 Resolution Proofs Propositional Logic: Bottom-Up Proofs CPSC 322 Logic 3, Slide 15

Top-down Ground Proof Procedure Idea: search backward from a query to determine if it is a logical consequence of KB. An answer clause is of the form: yes a 1 a 2... a m The SLD Resolution of this answer clause on atom a i with the clause: is the answer clause a i b 1... b p yes a 1 a i 1 b 1 b p a i+1 a m. Propositional Logic: Bottom-Up Proofs CPSC 322 Logic 3, Slide 16

Derivations An answer is an answer clause with m = 0. That is, it is the answer clause yes. A derivation of query?q 1... q k from KB is a sequence of answer clauses γ 0, γ 1,..., γ n such that γ 0 is the answer clause yes q 1... q k, γ i is obtained by resolving γ i 1 with a clause in KB, and γ n is an answer. Propositional Logic: Bottom-Up Proofs CPSC 322 Logic 3, Slide 17

Top-down definite clause interpreter To solve the query?q 1... q k : ac := yes q 1... q k repeat select atom a i from the body of ac; choose clause C from KB with a i as head; replace a i in the body of ac by the body of C until ac is an answer. Recall: Don t-care nondeterminism If one selection doesn t lead to a solution, there is no point trying other alternatives. select Don t-know nondeterminism If one choice doesn t lead to a solution, other choices may. choose Propositional Logic: Bottom-Up Proofs CPSC 322 Logic 3, Slide 18

Example: successful derivation Query:?a a b c. a e f. b f k. c e. d k. e. f j e. f c. j c. γ 0 : yes a γ 4 : yes e γ 1 : yes e f γ 5 : yes γ 2 : yes f γ 3 : yes c Propositional Logic: Bottom-Up Proofs CPSC 322 Logic 3, Slide 19

Example: failing derivation Query:?a a b c. a e f. b f k. c e. d k. e. f j e. f c. j c. γ 0 : yes a γ 4 : yes e k c γ 1 : yes b c γ 5 : yes k c γ 2 : yes f k c γ 3 : yes c k c Propositional Logic: Bottom-Up Proofs CPSC 322 Logic 3, Slide 20

Search Graph yes a^d a b c. a g. a h. b j. b k. d m. d p. f m. f p. g m. g f. k m. h m. p.?a d yes b^c^d yes m^d yes m^d yes j^c^d yes f^d yes k^c^d yes m^c^d yes h^d yes g^d yes m^d yes m yes p^d yes d yes p yes Propositional Logic: Bottom-Up Proofs CPSC 322 Logic 3, Slide 21