Logic: Propositional Logic Truth Tables

Similar documents
Logic: Propositional Logic Tableaux

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

Logical Structures in Natural Language: Propositional Logic II (Truth Tables and Reasoning

Logic: Propositional Logic (Part I)

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

Logic: First Order Logic

Logic: First Order Logic

Learning Goals of CS245 Logic and Computation

Logical Agents (I) Instructor: Tsung-Che Chiang

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):

Logical Agents. Knowledge based agents. Knowledge based agents. Knowledge based agents. The Wumpus World. Knowledge Bases 10/20/14

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

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

Notes for the Logic Course 2010/2011

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning

Artificial Intelligence Chapter 7: Logical Agents

Inference Methods In Propositional Logic

Propositional Logic: Part II - Syntax & Proofs 0-0

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

Logical Agents. Chapter 7

First Order Logic: Syntax and Semantics

Intelligent Agents. Pınar Yolum Utrecht University

Proof Methods for Propositional Logic

Classical First-Order Logic

THE LANGUAGE OF FIRST-ORDER LOGIC (FOL) Sec2 Sec1(1-16)

Propositional Logic: Logical Agents (Part I)

Chapter 3: Propositional Calculus: Deductive Systems. September 19, 2008

Inference Methods In Propositional Logic

Propositional logic (revision) & semantic entailment. p. 1/34

Natural Deduction for Propositional Logic

Logical Agents. Outline

Introduction to Logic in Computer Science: Autumn 2006

Class Assignment Strategies

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

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

Logical Structures in Natural Language: First order Logic (FoL)

First-Order Logic. 1 Syntax. Domain of Discourse. FO Vocabulary. Terms

Logic and Inferences

Overview. CS389L: Automated Logical Reasoning. Lecture 7: Validity Proofs and Properties of FOL. Motivation for semantic argument method

Computational Logic. Davide Martinenghi. Spring Free University of Bozen-Bolzano. Computational Logic Davide Martinenghi (1/30)

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

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

Introduction to Intelligent Systems

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence

Chapter 4: Classical Propositional Semantics

Advanced Topics in LP and FP

Introduction to Artificial Intelligence. Logical Agents

Logical Agent & Propositional Logic

Knowledge Representation. Propositional logic

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

Artificial Intelligence. Propositional logic

Applied Logic. Lecture 1 - Propositional logic. Marcin Szczuka. Institute of Informatics, The University of Warsaw

Classical Propositional Logic

Great Theoretical Ideas

COMP3702/7702 Artificial Intelligence Week 5: Search in Continuous Space with an Application in Motion Planning " Hanna Kurniawati"

Propositional logic II.

Modal Logic XX. Yanjing Wang

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

Logic & Logic Agents Chapter 7 (& background)

CS 380: ARTIFICIAL INTELLIGENCE

KB Agents and Propositional Logic

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel

Propositional Logic: Methods of Proof (Part II)

Syntax. Notation Throughout, and when not otherwise said, we assume a vocabulary V = C F P.

cis32-ai lecture # 18 mon-3-apr-2006

Language of Propositional Logic

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

Classical First-Order Logic

Agenda. Artificial Intelligence. Reasoning in the Wumpus World. The Wumpus World

INF5390 Kunstig intelligens. Logical Agents. Roar Fjellheim

Propositional Logic: Deductive Proof & Natural Deduction Part 1

Knowledge representation DATA INFORMATION KNOWLEDGE WISDOM. Figure Relation ship between data, information knowledge and wisdom.

Knowledge Representation. Propositional logic.

Overview of Today s Lecture

Logical agents. Chapter 7. Chapter 7 1

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

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

Deliberative Agents Knowledge Representation I. Deliberative Agents

Foundations of Artificial Intelligence

CS:4420 Artificial Intelligence

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

15414/614 Optional Lecture 1: Propositional Logic

Kecerdasan Buatan M. Ali Fauzi

Announcements. CS311H: Discrete Mathematics. Propositional Logic II. Inverse of an Implication. Converse of a Implication

TDT4136 Logic and Reasoning Systems

Logical Agent & Propositional Logic

Introduction to Intelligent Systems

AI Principles, Semester 2, Week 2, Lecture 5 Propositional Logic and Predicate Logic

6. Logical Inference

CHAPTER 4 CLASSICAL PROPOSITIONAL SEMANTICS

First-Order Logic First-Order Theories. Roopsha Samanta. Partly based on slides by Aaron Bradley and Isil Dillig

Propositional Logic: Logical Agents (Part I)

Propositional Logic: Review

Symbolic Logic 3. For an inference to be deductively valid it is impossible for the conclusion to be false if the premises are true.

EXERCISE 10 SOLUTIONS

Propositional Logic: Methods of Proof (Part II)

PHIL12A Section answers, 28 Feb 2011

Transcription:

Logic: Propositional Logic Truth Tables Raffaella Bernardi bernardi@inf.unibz.it P.zza Domenicani 3, Room 2.28 Faculty of Computer Science, Free University of Bolzano-Bozen http://www.inf.unibz.it/~bernardi/courses/logic06

Contents 1 Summary of last lesson..................................... 4 2 Satisfiability and Validity................................... 5 3 Exercise.................................................. 7 4 Consequences............................................. 8 5 Exercise: Counter-example................................. 9 6 Exercise.................................................. 10 6.1 Graph Coloring Problem............................. 11 6.2 Solution........................................... 12 7 Classical Satisfiability Problem: Graph Coloring............... 13 8 Summary: Reasoning Problems............................. 14 8.1 Entailment......................................... 14 8.2 Satisfiability........................................ 15 9 Other kinds of exercises.................................... 16 10 Properties of Entailment................................... 17 11 Decision Procedures in Logic: soundness..................... 18 12 Decision Procedures in Logic: completeness................... 19 13 Sound and Incomplete Algorithms........................... 20

14 Good Decision procedures.................................. 21 15 An extreme example....................................... 22 16 Propositional Decision Procedures........................... 23 16.1 Recall............................................. 24 17 Reduction to satisfiability.................................. 25 18 Home work............................................... 26

1. Summary of last lesson Last time we said: Syntax of PL: atomic vs. complex formulas Semantics of PL: truth tables Formalization of an argument Interpretation function Domain Model Entailment Satisfiability [exercises] [exercises] [exercises] [again next time] [again next time] [again next time] [again next time] [again next time]

2. Satisfiability and Validity An interpretation I is a model of φ: I = φ A formula φ is satisfiable, if there is some I that satisfies φ, unsatisfiable, if φ is not satisfiable, falsifiable, if there is some I that does not satisfy φ, valid (i.e., a tautology), if every I is a model of φ. Two formulas are logically equivalent (φ ψ), if for all I: I = φ iff I = ψ

3. Exercise Satisfiable, tautology? (((a b) a) b) (( φ ψ) (ψ φ)) (a b c) ( a b d) ( a b d) Equivalent? (φ ψ) φ ψ (φ ψ) ( ψ φ) (φ (ψ χ)) ((φ ψ) (ψ χ)) Try to use truth tables to support your conclusions.

4. Consequences Proposition: φ is a tautology iff φ is unsatisfiable φ is unsatisfiable iff φ is a tautology. Proposition: φ ψ iff φ ψ is a tautology. Theorem: If φ and ψ are equivalent, and χ results from replacing φ in χ by ψ, then χ and χ are equivalent.

5. Exercise: Counter-example Recall last time exercise: Check whether the following argument is valid: If Paul lives in Dublin, he lives in Ireland. Paul lives in Ireland. Therefore Paul lives in Dublin. (i) Give the keys of your formalization using PL; (ii) represent the argument formally; and (iii) Apply the truth table method to prove or disprove the validity of the argument. Now, iv) Build a counterexample if the argumentation is not valid. counterexample a model in which the reasoning does not hold. In other words, an interpretation such that the premises are true and the conclusion is false.

6. Exercise Given the graph: Italy is connected to Austria Austria is connected to Hungary By means of truth tables, find a coloring function C : V {black, white} such that no two adjacent countries have the same color.

6.1. Graph Coloring Problem First of all, we have to formalize our general knowledge about graphs and color assignments. Let 1, 2... n be our vertices, and B (blue), R (red), G (green)... be our colors, and let B i, C i,j stand for i is of color B and i is connected to j. Reflexivity of edges: C 1,2 C 2,1,... (so for the other connected vertices) Coloring of vertices: B 1 G 1 R 1... (so for the colors and for the other vertices) Uniqueness of colors per veritex: B 1 ( G 1 R 1 )... (so for the other vertices) Secondly, we have to add the explicitly given constraints. For instance, the coloring function has to be such that no two connected vertices have the same color: Explicit Constraint: C 1,2 (B 1 B 2 ) (R 1 R 2 ) (G 1 G 2 )... (so for the other colors and the other vertices)

6.2. Solution Vertex axioms: (the dual are redundant) [Uniqueness constraint] (B I W I ) (B H W H ) (B A W A ) Edge axioms: (the dual are redundant) [Explicit Constraint] (B I B A ) (W I W A ) (B H B A ) (W H W A ) By means of an inference procedure we can find the interpretation satisfying the theory. (The problem is satisfiable.)

7. Classical Satisfiability Problem: Graph Coloring Let KB (the set of sentences) be a theory consisting of the general knowledge about colors and graphs, and the constraint that the coloring function has to be such that no two connected vertices have the same color. We could be faced with the following kind of problems: (A) Given a graph and a coloring function, check whether they satisfy KB. (B) Given a graph, assign colors which satisfy KB. (C) Find a model (a graph and a color assignment) satisfying the KB.

8. Summary: Reasoning Problems 8.1. Entailment You are asked to check the validity of a given reasoning, i.e. whether the given set of axioms (premises, KB) entails the given sentence (conclusion, α) KB = α. If it does not you could be asked to provide a counterexample. Strategy To solve the problem you have to: represent the sentences in a formal language, PL. use an inference procedure (e.g. Truth Tables or Tableaux) to answer the question. prove that the conclusion is true in all cases (for all the interpretations) in which the premises are (all) true.

8.2. Satisfiability (A) You are given a set of sentences and an interpretation (i.e. a domain and an interpretation function), and are asked to check whether the sentences are all true in this interpretation. (B) You are given a set of sentences and a domain, and are asked to find an interpretation for the domain satisfying the given sentences. (C) You are given a set of sentences and are asked to provide a model (ie. a domain and an interpretation function satisfying them) Strategy To solve the problem, you have to: represent the axioms in a formal language, PL. use an inference procedure (e.g. Truth Tables or Tableaux) to answer the question. prove that the (found or given) interpretation is such that the set of sentences are all true simultaneously. (To prove validity you have to prove that this holds for all the interpretations.)

9. Other kinds of exercises Find an interpretation and a formula such that the formula is true in that interpretation (or: the interpretation satisfies the formula). Find an interpretation and a formula such that the formula is not true in that interpretation (or: the interpretation does not satisfy the formula). Find a formula which can t be true in any interpretation (or: no interpretation can satisfy the formula).

10. Properties of Entailment Θ {φ} = ψ iff Θ = φ ψ (Deduction Theorem) Θ {φ} = ψ iff Θ {ψ} = φ (Contraposition Theorem) Θ {φ} is unsatisfiable iff Θ = φ (Contradiction Theorem) Question: Can we decide whether Θ = ψ without considering all interpretations?

11. Decision Procedures in Logic: soundness A decision procedure solves a problem with yes or no answers. Our problem is entailment. KB i α Sentence α can be derived from the set of sentences KB by procedure i. Soundness: procedure i is sound if whenever procedure i proves that a sentence α can be derived from a set of sentences KB (KB i α), then it is also true that KB entails α (KB = α). It guarantees that IF KB i α THEN KB = α. no wrong inferences are drawn A sound procedure may fail to find the solution in some cases, when there is actually one; i.e. we could have: KB i α and KB = α

12. Decision Procedures in Logic: completeness A decision procedure solves a problem with yes or no answers. Our problem is entailment. KB i α Sentence α can be derived from the set of sentences KB by procedure i. Completeness: procedure i is complete if whenever a set of sentences KB entails a sentence α (KB = α), then procedure i proves that α can be derived from KB (KB i α). It guarantees that IF KB = α THEN KB i α. all the correct inferences are drawn A complete procedure may claim to have found a solution in some cases, when there is actually no solution, i.e. we could have: KB = α and KB i α

13. Sound and Incomplete Algorithms Sound and incomplete algorithms are very popular: they are considered good approximations of problem solving procedures. they may have a lower complexity than a sound and complete algorithm. they are often used due to the inability of programmers to find sound and complete algorithms or the impossibility of finding sound and complete algorithms (i.e. when the problem is undecidable)

14. Good Decision procedures If an incomplete reasoning mechanism is provided, we can conclude either that the semantics of the representation language does not really capture the meaning of the world and of what should follow, or that the algorithms can not infer all the things we would expect. Having sound and complete reasoning procedures is important! they guarantee that KB i α IFF KB = α.

15. An extreme example Let s consider two decision procedures: F, which always returns the result no independently from its input T, which always returns the result yes independently from its input Let s consider the problem of computing entailment between formulas; Which of the two procedures is sound and which is complete? F is a sound algorithm for computing entailment. T is a complete algorithm for computing entailment.

16. Propositional Decision Procedures Truth tables provide a sound and complete decision procedure for testing satisfiability, validity, and entailment in propositional logic. The proof is based on the observation that truth tables enumerate all possible models. Satisfiability, validity, and entailment in propositional logic are thus decidable problems. For problems involving a large number of atomic propositions the amount of calculation required by using truth tables may be prohibitive (always 2 n, where n is the number of atomic proposition involved in the formulas).

16.1. Recall A problem is either decidable (there is always an answer) or undecidable. A decision procedure is a program that always terminates and gives a yes or no answer. A decision procedure may be sound and/or complete with respect to a given problem. If we have a decision procedure that is sound and complete w.r.t. a given problem, then the problem is decidable.

17. Reduction to satisfiability A formula φ is satisfiable iff there is some interpretation I (i.e., a truth value assignment) that satisfies φ (i.e., φ is true under I: I = φ). Validity, equivalence, and entailment can be reduced to satisfiability: φ is a valid (i.e., a tautology) iff φ is not satisfiable. φ entails ψ (φ = ψ) iff φ ψ is valid (deduction theorem). φ = ψ iff φ ψ is not satisfiable. φ is equivalent to ψ (φ ψ) iff φ ψ is valid. φ ψ iff φ = ψ and ψ = φ Hence, a sound and complete procedure deciding satisfiability is all we need, and the tableaux method is a decision procedure which checks the existence of a model.

18. Home work Bring at the Lab (October 27th) the solutions for the exercises. Today key topics: Interpretation function [exercises] Domain [exercises] Model [exercises] Entailment [exercises] Satisfiability, unsatisfiability, validity [exercises] Counter-example [exercises] Next time: Tableaux method. (26.10!!)