Automated Reasoning Lecture 2: Propositional Logic and Natural Deduction

Similar documents
Advanced Topics in LP and FP

Introduction to Isabelle/HOL

02 Propositional Logic

First Order Logic: Syntax and Semantics

Learning Goals of CS245 Logic and Computation

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

Přednáška 12. Důkazové kalkuly Kalkul Hilbertova typu. 11/29/2006 Hilbertův kalkul 1

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

15414/614 Optional Lecture 1: Propositional Logic

Natural Deduction for Propositional Logic

Inference in Propositional Logic

Deductive Systems. Lecture - 3

Natural Deduction. Formal Methods in Verification of Computer Systems Jeremy Johnson

Propositional Logic. CS 3234: Logic and Formal Systems. Martin Henz and Aquinas Hobor. August 26, Generated on Tuesday 31 August, 2010, 16:54

Propositional Logic: Review

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

The Importance of Being Formal. Martin Henz. February 5, Propositional Logic

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

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

Propositional Logic Language

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

Logic. Propositional Logic: Syntax

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

Logic, Human Logic, and Propositional Logic. Human Logic. Fragments of Information. Conclusions. Foundations of Semantics LING 130 James Pustejovsky

Language of Propositional Logic

Artificial Intelligence. Propositional Logic. Copyright 2011 Dieter Fensel and Florian Fischer

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

Propositional Logic: Methods of Proof (Part II)

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

Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras. Lecture - 15 Propositional Calculus (PC)

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

Propositional Logic: Syntax

Propositional Logic: Methods of Proof (Part II)

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.

Inf2D 13: Resolution-Based Inference

AI Programming CS S-09 Knowledge Representation

Computation and Logic Definitions

Propositional Logic: Syntax

Intelligent Systems. Propositional Logic. Dieter Fensel and Dumitru Roman. Copyright 2008 STI INNSBRUCK

Artificial Intelligence. Propositional logic

Examples: P: it is not the case that P. P Q: P or Q P Q: P implies Q (if P then Q) Typical formula:

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

Automated Reasoning Lecture 5: First-Order Logic

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

Propositional Logics and their Algebraic Equivalents

Logic: Propositional Logic (Part I)

Logical Agents (I) Instructor: Tsung-Che Chiang

Propositional logic. First order logic. Alexander Clark. Autumn 2014

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

Propositional Logic: Models and Proofs

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

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

Propositional Logic. Logic. Propositional Logic Syntax. Propositional Logic

Propositional Logic Arguments (5A) Young W. Lim 10/11/16

CS 7180: Behavioral Modeling and Decision- making in AI

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

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

Propositional Logic Part 1

Inference Methods In Propositional Logic

First Order Logic: Syntax and Semantics

Proof Methods for Propositional Logic

A brief introduction to Logic. (slides from

Discrete Mathematics

Today s Lecture 2/25/10. Truth Tables Continued Introduction to Proofs (the implicational rules of inference)

Introduction to Metalogic

CSCE 222 Discrete Structures for Computing. Propositional Logic. Dr. Hyunyoung Lee. !!!!!! Based on slides by Andreas Klappenecker

Intelligent Agents. First Order Logic. Ute Schmid. Cognitive Systems, Applied Computer Science, Bamberg University. last change: 19.

Propositional Logic: Deductive Proof & Natural Deduction Part 1

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

Notes on Inference and Deduction

03 Propositional Logic II

Math 267a - Propositional Proof Complexity. Lecture #1: 14 January 2002

KB Agents and Propositional Logic

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel

Inference in first-order logic

Marie Duží

Artificial Intelligence Chapter 7: Logical Agents

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

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

Inference Methods In Propositional Logic

Agents that reason logically

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

Artificial Intelligence Knowledge Representation I

MAI0203 Lecture 7: Inference and Predicate Calculus

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

Propositional Logic. Yimei Xiang 11 February format strictly follow the laws and never skip any step.

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

Introduction to Metalogic 1

CS 771 Artificial Intelligence. Propositional Logic

Propositional Logic Arguments (5A) Young W. Lim 11/8/16

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

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

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

Classical Propositional Logic

Logical Agents. September 14, 2004

Knowledge based Agents

PL: Truth Trees. Handout Truth Trees: The Setup

Propositional Logic: Bottom-Up Proofs

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence

Transcription:

Automated Reasoning Lecture 2: Propositional Logic and Natural Deduction Jacques Fleuriot jdf@inf.ed.ac.uk

Logic Puzzles 1. Tomorrow will be sunny or rainy. Tomorrow will not be sunny. What will the weather be tomorrow? 2. I like classical or pop music. If I like classical music, then I am sophisticated. I don t like pop music. Am I sophisticated? 3. Fred bought milk or Fred bought lemonade. Fred bought milk or Fred bought water. Fred did not buy both water and lemonade. What did Fred buy?

Syntax of Propositional Logic Propositional Logic represents the problems we have just seen by using symbols to represent (atomic) propositions. These can be combined using the following connectives: Name symbol usage not P and P Q or P Q implies P Q if and only if P Q precedence Treat all binary connectives as right associative (following Isabelle) Example 1. (SunnyTomorrow RainyTomorrow) ( SunnyTomorrow) 2. (Class Pop) (Class Soph) Prop 3. (M L) (M W) (L W)

Syntax and Ambiguity The meanings of some statements can (appear to) be ambiguous: Class Pop Class Soph Pop We can use brackets (parentheses) to disambiguate a statement: (Class Pop) (Class Soph Pop) Note that, based on our choice of precedence (on the previous slide), A B C denotes A (B C) Also note that implication is right associative, so: P Q R denotes P (Q R)

Formal Syntax A syntactically correct formula is called a well-formed formula (wff) Given a (possible infinite) alphabet of propositional symbols L, the set of wffs is the smallest set such that any symbol A L is a wff; if P and Q are wffs, so are P, P Q, P Q, P Q, and P Q; if P is a wff, then (P) is a wff. When we are interested in abstract syntax (tree-structure of formulas) rather than concrete syntax, we forget the last clause.

Semantics Each wff is assigned a meaning or semantics, T or F, depending on whether its constituent wffs are assigned T or F. Truth tables are one way to assign truth values to wffs. P Q P Q T T T T F F F T F F F F P P T F F T P Q P Q T T T T F T F T T F F F P Q P Q T T T T F F F T T F F T

Semantics of the weather problem 1 Tomorrow will be sunny or rainy 2 Tomorrow will not be sunny What will the weather be tomorrow? SunnyTomorrow T T F F RainyTomorrow T F T F 1 2 1 2 S R S (S R) S

Semantics of the weather problem 1 Tomorrow will be sunny or rainy 2 Tomorrow will not be sunny What will the weather be tomorrow? SunnyTomorrow RainyTomorrow 1 2 1 2 S R S (S R) S T T T T F F T F F

Semantics of the weather problem 1 Tomorrow will be sunny or rainy 2 Tomorrow will not be sunny What will the weather be tomorrow? SunnyTomorrow RainyTomorrow 1 2 1 2 S R S (S R) S T T T T F T F T F F

Semantics of the weather problem 1 Tomorrow will be sunny or rainy 2 Tomorrow will not be sunny What will the weather be tomorrow? SunnyTomorrow RainyTomorrow 1 2 1 2 S R S (S R) S T T T T F T F T T F F

Semantics of the weather problem 1 Tomorrow will be sunny or rainy 2 Tomorrow will not be sunny What will the weather be tomorrow? SunnyTomorrow RainyTomorrow 1 2 1 2 S R S (S R) S T T T T F T F T T F F F

Semantics of the weather problem 1 Tomorrow will be sunny or rainy 2 Tomorrow will not be sunny What will the weather be tomorrow? SunnyTomorrow RainyTomorrow 1 2 1 2 S R S (S R) S T T T F T F T F T T F F F

Semantics of the weather problem 1 Tomorrow will be sunny or rainy 2 Tomorrow will not be sunny What will the weather be tomorrow? SunnyTomorrow RainyTomorrow 1 2 1 2 S R S (S R) S T T T F T F T F F T T F F F

Semantics of the weather problem 1 Tomorrow will be sunny or rainy 2 Tomorrow will not be sunny What will the weather be tomorrow? SunnyTomorrow RainyTomorrow 1 2 1 2 S R S (S R) S T T T F T F T F F T T T F F F

Semantics of the weather problem 1 Tomorrow will be sunny or rainy 2 Tomorrow will not be sunny What will the weather be tomorrow? SunnyTomorrow RainyTomorrow 1 2 1 2 S R S (S R) S T T T F T F T F F T T T F F F T

Semantics of the weather problem 1 Tomorrow will be sunny or rainy 2 Tomorrow will not be sunny What will the weather be tomorrow? SunnyTomorrow RainyTomorrow 1 2 1 2 S R S (S R) S T T T F F T F T F F T T T F F F T

Semantics of the weather problem 1 Tomorrow will be sunny or rainy 2 Tomorrow will not be sunny What will the weather be tomorrow? SunnyTomorrow RainyTomorrow 1 2 1 2 S R S (S R) S T T T F F T F T F F F T T T F F F T

Semantics of the weather problem 1 Tomorrow will be sunny or rainy 2 Tomorrow will not be sunny What will the weather be tomorrow? SunnyTomorrow RainyTomorrow 1 2 1 2 S R S (S R) S T T T F F T F T F F F T T T T F F F T

Semantics of the weather problem 1 Tomorrow will be sunny or rainy 2 Tomorrow will not be sunny What will the weather be tomorrow? SunnyTomorrow RainyTomorrow 1 2 1 2 S R S (S R) S T T T F F T F T F F F T T T T F F F T F

Semantics of the weather problem 1 Tomorrow will be sunny or rainy 2 Tomorrow will not be sunny What will the weather be tomorrow? SunnyTomorrow RainyTomorrow 1 2 1 2 S R S (S R) S T T T F F T F T F F F T T T T F F F T F So it will rain tomorrow.

Semantics: Definitions Definition (Interpretation) An interpretation (or valuation) is a truth assignment to the symbols in the alphabet L: it is a function V from L to {T, F}.

Semantics: Definitions Definition (Interpretation) An interpretation (or valuation) is a truth assignment to the symbols in the alphabet L: it is a function V from L to {T, F}. An interpretation V of L is extended to an interpretation of a wff P by induction on its structure: A V = V(A) P Q V = P V and Q V P Q V = P V or Q V P V = not P V P Q V = P V implies Q V This is the Tarski definition of truth: the truth value of a compound sentence is established by breaking it down until we get to atomic propositions.

Semantics: Definitions Definition (Satisfaction) An interpretation V satisfies a wff P if P V = T Definition (Satisfiable) A wff is satisfiable if there exists an interpretation that satisfies it. A wff is unsatisfiable if it is not satisfiable. Definition (Valid or Tautology) A wff is valid or is a tautology if every interpretation satisfies it. Example (S R) S is satisfiable (there is a state of affairs that makes it true) ((S R) S) R is valid (it is always true, no matter what the state of affairs)

Semantics: Definitions Definition (Entailment) The wffs P 1, P 2,..., P n entail Q if for any interpretation which satisfies all of P 1, P 2,..., P n also satisfies Q. We then write P 1, P 2,..., P n Q. Note If there is no interpretation which satisfies all of P 1, P 2,..., P n then P 1, P 2,..., P n Q for any Q. Contradictory assumptions entail everything! Note Everything entails a tautology. If Q is a tautology, then P 1, P 2,..., P n Q holds not matter what P 1, P 2,... P n are. We write Q when Q is a tautology. Example Is P, Q Q (P Q) a valid entailment?

Proof, Inference Rules and Deductive Systems For propositional logic, it is possible to reason on a computer directly using the semantics: Satisfiability, validity and entailment are decidable So, in theory, we make conjectures and the computer checks them. But this is not always possible: Propositional logic is not very expressive; but Expressive logics like FOL and HOL are not decidable; and Even for propositional logic, checking satisfiability, validity, entailment is not always feasible. So we encode a notion of proof : A formal deductive system is a set of valid inference rules that tell us what conclusions we can draw from some premises. Inference rules can be applied manually or automatically. We will look at Natural Deduction, developed by Gentzen and Prawitz.

Inference Rules An inference rule tells us how one wff can be derived in one step from zero, one, or more other wffs. We write P 1 P 2... P n Q if wff Q is derived from wffs P 1, P 2,..., P n using the rule R. Example inference rules (with their corresponding Isabelle names): (R) P Q P Q (conji) P P Q (mp) Q The P and Q here are meta-variables (denoted by?p and?q in Isabelle) and mp is the modus ponens rule of inference. This rule schema characterises an infinite number of rule instances, obtained by substituting wffs for the P and Q. Example of an instance of mp is: P {}}{ A B P Q {}}{{}}{ (A B) C C }{{} Q

Validity Inference rules must be valid. They must preserve truth. Formally, for all instances of P 1 P 2... P n Q (R) of the rule R, we must have P 1, P 2,..., P n Q. Inference is transitive. If we can infer R from Q and we can infer Q from P, then we can infer R from P. This means we can chain deductions together to form a deduction tree.

Introduction and Elimination In Natural Deduction (ND), rules are split into two groups: Introduction rules : how to derive P Q P Q P Q (conji) P P Q (disji1) Q P Q (disji2) Elimination rules : what can be derived from P Q? P Q P (conjunct1) P Q Q (conjunct2) [P] [Q] P Q. R R. R (disje)

A proof: distributivity of and A proof that P (Q R) (P Q) (P R). P (Q R) Q R P (Q R) P [Q] P Q (P Q) (P R) (P Q) (P R) P (Q R) P [R] P R (P Q) (P R) Note Each proof step will normally be annotated with the name of its associated inference rule (e.g. disje for the bottom most step).

Ways of applying rules Inference rules are applied in two basic ways. Forward proof if we derive new wffs from existing wffs by applying rules top down. Backward proof if we conjecture some wff true and apply rules bottom-up to produce new wffs from which the original wff is derived. In Isabelle, procedural proof very often proceeds backwards, from the goal. Forward proof is also possible, though. structured proof tends to be via forward reasoning.

Summary Propositional logic Syntax (atomic propositions, wffs) (H&R 1.1+1.3) Semantics (interpretations, satisfication, satisfiability, validity, entailment) (H&R 1.4.1, first part of 1.4.2) Natural deduction (H&R 1.2) Introduction and Elimination rules; Proofs are trees, with assumptions at the leaves. Next time More on Natural Deduction (,, ); Natural deduction in Isabelle/HOL.