Discrete Mathematics

Similar documents
Discrete Mathematics

Automated Reasoning Lecture 2: Propositional Logic and Natural Deduction

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

Propositional Logic: Bottom-Up Proofs

Logik für Informatiker Formal proofs for propositional logic

Inference and Proofs (1.6 & 1.7)

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

Completeness for FOL

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

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

cse 311: foundations of computing Fall 2015 Lecture 6: Predicate Logic, Logical Inference

Intermediate Logic. Natural Deduction for TFL

FORMAL PROOFS DONU ARAPURA

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

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

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

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

Propositional Logic: Review

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

Inf2D 13: Resolution-Based Inference

Natural Deduction for Propositional Logic

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

Introduction to Isabelle/HOL

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

Propositional Logic. Argument Forms. Ioan Despi. University of New England. July 19, 2013

COMP Intro to Logic for Computer Scientists. Lecture 6

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

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

Discrete Structures of Computer Science Propositional Logic III Rules of Inference

Axiomatic systems. Revisiting the rules of inference. Example: A theorem and its proof in an abstract axiomatic system:

Advanced Topics in LP and FP

CITS2211 Discrete Structures Proofs

Deductive Systems. Lecture - 3

Propositional Logic. Logic. Propositional Logic Syntax. Propositional Logic

5. And. 5.1 The conjunction

Section 1.2: Propositional Logic

Inference Methods In Propositional Logic

Natural Deduction is a method for deriving the conclusion of valid arguments expressed in the symbolism of propositional logic.

Language of Propositional Logic

Manual of Logical Style (fresh version 2018)

Inference in Propositional Logic

Logical Agents (I) Instructor: Tsung-Che Chiang

Logik für Informatiker Logic for computer scientists

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Propositional Logic. Jason Filippou UMCP. ason Filippou UMCP) Propositional Logic / 38

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

Supplementary Logic Notes CSE 321 Winter 2009

Propositional Logic: Semantics and an Example

Tree Automata as Infinite Countermodels for Propositional Logics

AI Programming CS S-09 Knowledge Representation

Maryam Al-Towailb (KSU) Discrete Mathematics and Its Applications Math. Rules Math. of1101 Inference 1 / 13

Last Time. Inference Rules

NICTA Advanced Course. Theorem Proving Principles, Techniques, Applications. Gerwin Klein Formal Methods

Announcements For The Logic of Atomic Sentences Counterexamples & Formal Proofs. Logical Consequence & Validity The Definitions.

Inference Methods In Propositional Logic

Introduction to Metalogic

First Order Logic: Syntax and Semantics

CS 7180: Behavioral Modeling and Decision- making in AI

Logic for Computer Science - Week 4 Natural Deduction

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

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter p. 1/33

Propositional Logic: Deductive Proof & Natural Deduction Part 1

Adam Blank Spring 2017 CSE 311. Foundations of Computing I

First Order Logic: Syntax and Semantics

Proof Methods for Propositional Logic

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

PHIL 50 - Introduction to Logic

Propositional Logic. Spring Propositional Logic Spring / 32

Part Two: The Basic Components of the SOFL Specification Language

15414/614 Optional Lecture 1: Propositional Logic

Discrete Structures & Algorithms. Propositional Logic EECE 320 // UBC

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

NICTA Advanced Course. Theorem Proving Principles, Techniques, Applications

Proof Rules for Correctness Triples

Lecture 11: Measuring the Complexity of Proofs

Propositional Logics and their Algebraic Equivalents

8. Reductio ad absurdum

Artificial Intelligence

Practice Exam 2. You MUST show all your work, and indicate which value is the main operator value.

Lecture 2: Proof Techniques Lecturer: Lale Özkahya

KB Agents and Propositional Logic

Intelligent Agents. Pınar Yolum Utrecht University

Propositional Logic Review

Lecture 17: Floyd-Hoare Logic for Partial Correctness

Manual of Logical Style

Proving Things. Why prove things? Proof by Substitution, within Logic. Rules of Inference: applying Logic. Using Assumptions.

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

Predicate Logic. Andreas Klappenecker

Artificial Intelligence. Propositional logic

02 Propositional Logic

Propositional Reasoning

Agents that reason logically

CPSC 121: Models of Computation

4 Derivations in the Propositional Calculus

The Logic of Compound Statements cont.

Valid Reasoning. Alice E. Fischer. CSCI 1166 Discrete Mathematics for Computing February, Outline Truth and Validity Valid Reasoning

Introduction Logic Inference. Discrete Mathematics Andrei Bulatov

Logic: Bottom-up & Top-down proof procedures

Logic and Inferences

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

Transcription:

Discrete Mathematics Jeremy Siek Spring 2010 Jeremy Siek Discrete Mathematics 1 / 24

Outline of Lecture 3 1. Proofs and Isabelle 2. Proof Strategy, Forward and Backwards Reasoning 3. Making Mistakes Jeremy Siek Discrete Mathematics 2 / 24

Theorems and Proofs In the context of propositional logic, a theorem is just a tautology. In this course, we ll be writing theorems and their s in the Isabelle/Isar language. Here s the syntax for a theorem in Isabelle/Isar. theorem "P" - step 1 step 2.. step n Each step applies an inference rule to establish the truth of some proposition. Jeremy Siek Discrete Mathematics 3 / 24

Inference Rules When applying inference rules, use the keyword have to establish intermediate truths and use the keyword show to conclude the surrounding theorem or sub-. Most inference rules can be categorized as either an introduction or elimination rule. Introduction rules are for creating bigger propositions. Elimination rules are for using propositions. We write L i proves P if there is a preceeding step or assumption in the that is labeled L i and whose proposition is P. Jeremy Siek Discrete Mathematics 4 / 24

Introduction Rules And Or (1) Or (2) Implies If L i proves P and L j proves Q, then write from L i L j have L k : "P Q".. If L i proves P, then write from L i have L k : "P Q".. If L i proves Q, then write from L i have L k : "P Q".. have L k : "P Q" assume L i : "P". show "Q" Jeremy Siek Discrete Mathematics 5 / 24

Introduction Rules, cont d Not have L k : " P" assume L i : "P".. show "False" Hint: The Appendix of our text Isabelle/HOL A Proof Assistant for Higher-Order Logic lists the logical connectives, such as and, and for each of them gives two ways to input them as ASCI text. If you use Emacs (or XEmacs) to edit your Isabelle files, then the x-symbol package can be used to display the logic connectives in their traditional form. Jeremy Siek Discrete Mathematics 6 / 24

Using Assumptions Sometimes the thing you need to prove is already an assumption. In this case your job is really easy! If L i proves P, write from L i have "P". Jeremy Siek Discrete Mathematics 7 / 24

Example Proof theorem "p p" - show "p p" assume 1: "p" from 1 show "p". Instead of -, you can apply the introduction rule right away. theorem "p p" assume 1: "p" from 1 show "p". Jeremy Siek Discrete Mathematics 8 / 24

Exercise theorem "p (p p)" Jeremy Siek Discrete Mathematics 9 / 24

Solution theorem "p (p p)" assume 1: "p" from 1 1 show "p p".. Jeremy Siek Discrete Mathematics 10 / 24

Elimination Rules And (1) And (2) Or If L i proves P Q, then write from L i have L k : "P".. If L i proves P Q, then write from L i have L k : "Q".. If L i proves P Q, then write note L i moreover { assume L j : "P". have "R" } moreover { assume L m : "Q". have "R" } ultimately have L k : "R".. Jeremy Siek Discrete Mathematics 11 / 24

Elimination Rules, cont d Implies Not False If L i proves P Q and L j proves P, then write from L i L j have L k : "Q".. (This rule is known as modus ponens.) If L i proves P and L j proves P, then write from L i L j have L k : "Q".. If L i proves False, then write from L i have L k : "P".. Jeremy Siek Discrete Mathematics 12 / 24

Example Proof theorem "(p q) (p q)" assume 1: "p q" from 1 have 2: "p".. from 2 show "p q".. Jeremy Siek Discrete Mathematics 13 / 24

Another Proof theorem "(p q) (p r) (q r) r" assume 1: "(p q) (p r) (q r)" from 1 have 2: "p q".. from 1 have 3: "(p r) (q r)".. from 3 have 4: "p r".. from 3 have 5: "q r".. note 2 moreover { assume 6: "p" from 4 6 have "r".. } moreover { assume 7: "q" from 5 7 have "r".. } ultimately show "r".. Jeremy Siek Discrete Mathematics 14 / 24

Exercise theorem "(p q) (q r) (p r)" Jeremy Siek Discrete Mathematics 15 / 24

Solution theorem "(p q) (q r) (p r)" assume 1: "(p q) (q r)" from 1 have 2: "p q".. from 1 have 3: "q r".. show "p r" assume 4: "p" from 2 4 have 5: "q".. from 3 5 show "r".. Jeremy Siek Discrete Mathematics 16 / 24

Forward and Backwards Reasoning And-Intro (forward) And-Intro (backwards) If L i proves P and L j proves Q, then write from L i L j have L k : "P Q".. have L k : "P Q". show "P" next. show "Q" Jeremy Siek Discrete Mathematics 17 / 24

Forward and Backwards Reasoning, cont d Or-Intro (1) (forwards) Or-Intro (1) (backwards) If L i proves P, then write from L i have L k : "P Q".. have L k : "P Q" (rule disji1). show "P" Jeremy Siek Discrete Mathematics 18 / 24

Forward and Backwards Reasoning, cont d Or-Intro (2) (forwards) Or-Intro (2) (backwards) If L i proves Q, then write from L i have L k : "P Q".. have L k : "P Q" (rule disji2). show "Q" Jeremy Siek Discrete Mathematics 19 / 24

Strategy Let the proposition you re trying to prove guide your. Find the top-most logical connective. Apply the introduction rule, backwards, for that connective. Keep doing that until what you need to prove no longer contains any logical connectives. Then work forwards from your assumptions (using elimination rules) until you ve proved what you need. Assumption Forwards Reasoning Backwards Reasoning Conclusion Assumption Jeremy Siek Discrete Mathematics 20 / 24

Making Mistakes To err is human. Isabelle will catch your mistakes. Unfortunately, Isabelle is bad at describing your mistake. Consider the following attempted theorem "p (p p)" - show "p (p p)" assume 1: "p" from 1 show "p p" When Isabelle gets to from 1 show "p p" (adding.. at the end), it gives the following response: Failed to finish At command "..". Jeremy Siek Discrete Mathematics 21 / 24

Making Mistakes, cont d In this case, the mistake was a missing label in the from clause. Conjuction introduction requires two premises, not one. Here s the fix: theorem "p (p p)" - show "p (p p)" assume 1: "p" from 1 1 show "p p".. When Isablle says no, double check the inference rule. If that doesn t work, get a classmate to look at it. If that doesn t work, email the instructor with the minimal Isabelle file that exhibits your problem. Jeremy Siek Discrete Mathematics 22 / 24

Making Mistakes, cont d Here s another with a typo: theorem "p p" assume 1: "p" from 1 show "q". Isabelle responds with: Local statement will fail to refine any pending goal Failed attempt to solve goal by exported rule : (p) = q At command " show ". The problem here is that the proposition in the show "q", does not match what we are trying to prove, which is p. Jeremy Siek Discrete Mathematics 23 / 24

Stuff to Rememeber How to write Isabelle/Isar s of tautologies in Propositional Logic. The introduction and elimination rules. Forwards and backwards reasoning. Jeremy Siek Discrete Mathematics 24 / 24