Propositional logic II.

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

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

Inference in Propositional Logic

Knowledge Representation. Propositional logic

Knowledge Representation. Propositional logic.

Inference in first-order logic

Proof Methods for Propositional Logic

Inference in first-order logic

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

Intelligent Agents. Pınar Yolum Utrecht University

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

Advanced Topics in LP and FP

Inference in first-order logic

Logic and Inferences

Knowledge based Agents

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning

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

CS 380: ARTIFICIAL INTELLIGENCE

Artificial Intelligence Chapter 7: Logical Agents

Logical Agents. Chapter 7

Propositional Logic: Models and Proofs

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

Language of Propositional Logic

Propositional Resolution

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

Deductive Systems. Lecture - 3

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

Artificial Intelligence. Propositional logic

Propositional Logic: Review

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

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

Logical agents. Chapter 7. Chapter 7 1

Inference Methods In Propositional Logic

Logical Agents (I) Instructor: Tsung-Che Chiang

COMP219: Artificial Intelligence. Lecture 20: Propositional Reasoning

Artificial Intelligence

Propositional Logic: Methods of Proof (Part II)

Propositional Logic: Methods of Proof (Part II)

TDT4136 Logic and Reasoning Systems

Introduction to Artificial Intelligence. Logical Agents

Logical agents. Chapter 7. Chapter 7 1

7 LOGICAL AGENTS. OHJ-2556 Artificial Intelligence, Spring OHJ-2556 Artificial Intelligence, Spring

Artificial Intelligence

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

Logical Agents. Outline

Propositional Logic Part 1

Inference Methods In Propositional Logic

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

Propositional Reasoning

Logical Agents. September 14, 2004

Price: $25 (incl. T-Shirt, morning tea and lunch) Visit:

Deliberative Agents Knowledge Representation I. Deliberative Agents

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

Propositional Logic Basics Propositional Equivalences Normal forms Boolean functions and digital circuits. Propositional Logic.

Description Logics. Foundations of Propositional Logic. franconi. Enrico Franconi

CS 7180: Behavioral Modeling and Decision- making in AI

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

Logic: Propositional Logic (Part I)

Logical Agent & Propositional Logic

Propositional Logic. Logic. Propositional Logic Syntax. Propositional Logic

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

Kecerdasan Buatan M. Ali Fauzi

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

CS:4420 Artificial Intelligence

Class Assignment Strategies

Logical Agents. Chapter 7

Propositional Logic: Methods of Proof (Part II)

Logical Agents: Propositional Logic. Chapter 7

Propositional Logic. Testing, Quality Assurance, and Maintenance Winter Prof. Arie Gurfinkel

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel

Logical Agent & Propositional Logic

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

Propositional Logic: Bottom-Up Proofs

Introduction Logic Inference. Discrete Mathematics Andrei Bulatov

Introduction to Artificial Intelligence Propositional Logic & SAT Solving. UIUC CS 440 / ECE 448 Professor: Eyal Amir Spring Semester 2010

Propositional Resolution

CS 771 Artificial Intelligence. Propositional Logic

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

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence

A simple knowledge-based agent. Logical agents. Outline. Wumpus World PEAS description. Wumpus world characterization. Knowledge bases.

Inf2D 13: Resolution-Based Inference

Tecniche di Verifica. Introduction to Propositional Logic

Logical Agents. Santa Clara University

Inf2D 06: Logical Agents: Knowledge Bases and the Wumpus World

Lecture 6: Knowledge 1

AI Programming CS S-09 Knowledge Representation

Supplementary exercises in propositional logic

Lecture 2 Propositional Logic & SAT

Foundations of Artificial Intelligence

CS 188: Artificial Intelligence Spring 2007

Logic: Propositional Logic Truth Tables

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

CS 4700: Artificial Intelligence

CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS

Learning Goals of CS245 Logic and Computation

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

How to determine if a statement is true or false. Fuzzy logic deal with statements that are somewhat vague, such as: this paint is grey.

Part 1: Propositional Logic

Transcription:

Lecture 5 Propositional logic II. Milos Hauskrecht milos@cs.pitt.edu 5329 ennott quare Propositional logic. yntax yntax: ymbols (alphabet) in P: Constants: True, False Propositional symbols Examples: P Pitt is located in the Oakland section of Pittsburgh., It rains outside, etc. A set of connectives:,,,,

Propositional logic. yntax entences in the propositional logic: Atomic sentences: Constructed from constants and propositional symbols True, False are (atomic) sentences P, Q or Light in the room is on, It rains outside are (atomic) sentences Composite sentences: Constructed from valid sentences via connectives If A, B are sentences then A ( A B ) ( A B ) ( A B ) ( A B ) or ( A B ) ( A B ) are sentences Propositional logic. emantics. The semantic gives the meaning to sentences. the semantics in the propositional logic is defined by: 1. Interpretation of propositional symbols and constants emantics of atomic sentences 2. Through the meaning of connectives Meaning (semantics) of composite sentences

emantic: propositional symbols A propositional symbol represents: a statement about the world that is either true or false Examples: Pitt is located in the Oakland section of Pittsburgh It rains outside Light in the room is on An interpretation maps propositional symbols to one of the two values: True (T), or False (F), depending on whether the symbol is satisfied in the world I: Light in the room is on -> True, It rains outside -> False I : Light in the room is on -> False, It rains outside -> False emantic: propositional symbols The meaning (value) of the propositional symbol for a specific interpretation is given by its interpretation I: Light in the room is on -> True, It rains outside -> False V(Light in the room is on, I) = True V( It rains outside, I) = False I : Light in the room is on -> False, It rains outside -> False V(Light in the room is on, I ) = False

emantics: constants The meaning (truth) of constants: True and False constants are always (under any interpretation) assigned the corresponding True,False value V(True, I) = True V(False, I) = False For any interpretation I emantics: composite sentences The meaning (truth value) of complex propositional sentences. Determined using the standard rules of logic: P Q P P Q P Q P Q P Q True True False True True True True True False False False True False False False True True False True True False False False True False False True True Rows define all possible interpretations (worlds) I

Logical inference problem Logical inference problem: Given: a knowledge base KB (a set of sentences) and a sentence (called a theorem), Does a KB semantically entail α? In other words: In all interpretations in which sentences in the KB are true, is also true? α α KB = α? Inference procedures Inference is a process by which conclusions are reached. Our goal: We want to implement the inference process on a computer!! Question: Is there a procedure (program) that can decide this problem in a finite number of steps? Answer: Yes. Logical inference problem for the propositional logic is decidable.

Inference procedures: properties Assume an inference procedure i that derives a sentence α from the KB : KB i α Properties of the inference procedure wrt entailment oundness: An inference procedure is sound If KB i α then it is true that KB = α Completeness: An inference procedure is complete If KB = α then it is true that KB α i olving logical inference problem How to design the procedure that answers: = α KB? Three approaches: Truth-table approach Inference rules Conversion to the AT problem Resolution-refutation Covered last lecture

Inference rules for logic Modus ponens A B, B A premise conclusion If both sentences in the premise are true then conclusion is true. The modus ponens inference rule is sound. We can prove this through the truth table. A B A B False False True False True True True False False True True True Example. Inference rules approach. KB: P Q P R ( Q R) Theorem: 1. P Q 2. P R 3. 4. ( Q R) P From 1 and And-elim 5. R From 2,4 and Modus ponens 6. Q From 1 and And-elim 7. ( Q R) From 5,6 and And-introduction 8. From 7,3 and Modus ponens Proved:

Logic inferences and search To show that theorem α holds for a KB we may need to apply a number of sound inference rules Problem: many possible rules can be applied in the next step P R P R Q P Q, Q R, P R? This is an instance of a search problem: Truth table method (from the search perspective): blind enumeration and checking entence transformations Propositional logic: A sentence may include connectives:,,,, A sentence may consists of multiple nested sentences Do we need all operators to represent a complex sentence? No. We can rewrite a sentence in PL using an equivalent sentence with just,, operators Is it possible to limit the depth of the sentence structure? Yes. Example: Normal forms.

Normal forms entences in the propositional logic can be transformed into one of the normal forms. This can simplify the inferences. Normal forms used: Conjunctive normal form (CNF) conjunction of clauses (clauses include disjunctions of literals) ( A B) ( A C D ) Disjunctive normal form (DNF) Disjunction of terms (terms include conjunction of literals) ( A B) ( A C ) ( C D ) Assume: 1. Eliminate Conversion to a CNF 2. Reduce the scope of signs through DeMorgan Laws and double negation 3. Convert to CNF using the associative and distributive laws and ( A B) ( C A), ( A B) ( C A) ( A B) ( C A) ( A C A) ( B C A) ( A C ) ( B C A)

atisfiability (AT) problem Determine whether a sentence in the conjunctive normal form (CNF) is satisfiable (i.e. can evaluate to true) ( P Q R) ( P R ) ( P Q T )K It is an instance of a constraint satisfaction problem (CP): Variables: Propositional symbols (P, R, T, ) Values: True, False Constraints: Every conjunct must evaluate to true, at least one of the literals must evaluate to true olving AT An NP-complete problem Methods: Backtracking: equivalent to the depth first search Pick the variable, then pick its value (T or F) Continue till all variables are assigned or till the partial assignment makes the sentence False Iterative optimization methods: tart from an arbitrary assignment of T,F values to symbols Flip T,F values for one variable Heuristics: prefer assignments that make more clauses true Walk-AT, simulated-annealing procedures

Inference problem and satisfiability Logical inference problem: we want to show that the sentence α is entailed by KB For all interpretations for which KB is true is α also true? atisfiability (AT) problem: Is there is some assignment (interpretation) under which the sentence evaluates to true? Is it possible to formulate a logical inference problem as a satisfiability problem? Inference problem and satisfiability Logical inference problem: For all interpretations for which KB is true is α also true? atisfiability: Is there is some assignment (interpretation) under which a sentence evaluates to true Connection: KB = α ( KB α ) if and only if is unsatisfiable Consequences: inference problem is NP-complete programs for solving the AT problem can be used to solve the inference problem

Inferences with the CNF Can inference rule approach benefit from the CNF conversion? Is there an inference rule that is sufficient to support all inferences for the KB in the CNF form? A rule that seems to fit very well the CNF form is the resolution rule. Resolution rule Resolution rule sound inference rule that works for the KB in the CNF form A B, B C A C A B C A B B C A C

Inferences with the resolution rule Resolution rule is sound Is it complete? Is it possible to use it such that we start from the KB, then prove the new facts and eventually prove the theorem if it is entailed? Not always = incomplete Repeated application of the resolution rule to a KB in CNF may fail to derive new valid sentences Example: We know: ( A B) We want to show: ( A B) Resolution rule fails to derive it (incomplete??) atisfiability inferences with the resolution rule Conversion to AT: proof by contradiction Disproving: ( KB α ) Proves the entailment KB = α Important: The resolution rule is sufficient to determine satisfiability/unsatisfiability of ( KB α ) For any KB and theorem in the CNF We say the resolution rule is refutation complete.

Resolution algorithm Algorithm: Convert KB to the CNF form; Apply iteratively the resolution rule starting from ( KB α ) (in CNF form) top when: Contradiction (empty clause) is reached: A, A O proves entailment. No more new sentences can be derived disproves it. Example. Resolution. KB: ( P Q) ( P R) [( Q R) ] Theorem: tep 1. convert KB to CNF: P Q P Q P R ( P R ) ( Q R) ( Q R ) KB: P Q ( P R ) ( Q R ) tep 2. Negate the theorem to prove it via refutation tep 3. Run resolution on the set of clauses P Q ( P R ) ( Q R )

Example. Resolution. KB: ( P Q) ( P R) [( Q R) ] Theorem: P Q ( P R ) ( Q R ) Example. Resolution. KB: ( P Q) ( P R) [( Q R) ] Theorem: P Q ( P R ) ( Q R ) R

Example. Resolution. KB: ( P Q) ( P R) [( Q R) ] Theorem: P Q ( P R ) ( Q R ) R ( R ) Example. Resolution. KB: ( P Q) ( P R) [( Q R) ] Theorem: P Q ( P R ) ( Q R ) R ( R )

Example. Resolution. KB: ( P Q) ( P R) [( Q R) ] Theorem: P Q ( P R ) ( Q R ) R ( R ) Contradiction {} Proved: