Elementary Metamathematics

Slides:



Advertisements
Similar presentations
SAT Solver CS 680 Formal Methods Jeremy Johnson. 2 Disjunctive Normal Form  A Boolean expression is a Boolean function  Any Boolean function can be.
Advertisements

1 Logic Logic in general is a subfield of philosophy and its development is credited to ancient Greeks. Symbolic or mathematical logic is used in AI. In.
Disjunctive Normal Form CS 680: Formal Methods Jeremy Johnson.
For Friday No reading Homework: –Chapter 9, exercise 4 (This is VERY short – do it while you’re running your tests) Make sure you keep variables and constants.
Logic Use mathematical deduction to derive new knowledge.
Logic Concepts Lecture Module 11.
Inference and Resolution for Problem Solving
Restricted Satisfiability (SAT) Problem
Knoweldge Representation & Reasoning
Propositional Calculus Math Foundations of Computer Science.
Propositional Equivalence Goal: Show how propositional equivalences are established & introduce the most important such equivalences.
Propositional Calculus Math Foundations of Computer Science.
Propositional Calculus CS 680: Formal Methods in Verification Computer Systems Jeremy Johnson.
Adapted from Discrete Math
CS1502 Formal Methods in Computer Science Lecture Notes 10 Resolution and Horn Sentences.
SAT Solver Math Foundations of Computer Science. 2 Boolean Expressions  A Boolean expression is a Boolean function  Any Boolean function can be written.
Systems Architecture I1 Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they.
Proof Systems KB |- Q iff there is a sequence of wffs D1,..., Dn such that Dn is Q and for each Di in the sequence: a) either Di is in KB or b) Di can.
1 Inference Rules and Proofs (Z); Program Specification and Verification Inference Rules and Proofs (Z); Program Specification and Verification.
Normal Forms, Tautology and Satisfiability 2/3/121.
CS1502 Formal Methods in Computer Science
Apr. 3, 2000Systems Architecture I1 Systems Architecture I (CS ) Lecture 3: Review of Digital Circuits and Logic Design Jeremy R. Johnson Mon. Apr.
INTRODUCTION TO ARTIFICIAL INTELLIGENCE COS302 MICHAEL L. LITTMAN FALL 2001 Satisfiability.
Advanced Topics in Propositional Logic Chapter 17 Language, Proof and Logic.
Fallacies The proposition [(p  q)  q]  p is not a tautology, because it is false when p is false and q is true. This type of incorrect reasoning is.
Propositional Calculus – Methods of Proof Predicate Calculus Math Foundations of Computer Science.
1 CMSC 250 Discrete Structures CMSC 250 Lecture 1.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
Propositional calculus
LDK R Logics for Data and Knowledge Representation Propositional Logic: Reasoning First version by Alessandro Agostini and Fausto Giunchiglia Second version.
Propositional Logic. Propositions Any statement that is either True (T) or False (F) is a proposition Propositional variables: a variable that can assume.
Extra slides for Chapter 3: Propositional Calculus & Normal Forms Based on Prof. Lila Kari’s slides For CS2209A, 2009 By Dr. Charles Ling;
Discrete Mathematics CS 2610 September Equal Boolean Functions Two Boolean functions F and G of degree n are equal iff for all (x 1,..x n )  B.
CS6133 Software Specification and Verification
Disjunctive Normal Form CS 270: Math Foundation of CS Jeremy Johnson.
Satisfiability and SAT Solvers CS 270 Math Foundations of CS Jeremy Johnson.
1 Section 6.2 Propositional Calculus Propositional calculus is the language of propositions (statements that are true or false). We represent propositions.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Basic Concepts and Background.
Boolean Expression Evaluation CS 270: Math Foundations of CS Jeremy Johnson.
The Logic of Boolean Connectives Chapter 4 Language, Proof and Logic.
1 Proving Properties of Recursive List Functions CS 270 Math Foundations of CS Jeremy Johnson.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
Truth Table to Statement Form
Chapter 7. Propositional and Predicate Logic
2. The Logic of Compound Statements Summary
Propositional Equivalence
Propositional Calculus: Boolean Functions and Expressions
Knowledge Representation and Reasoning
Resolution in the Propositional Calculus
The Propositional Calculus
Discussion #10 Logical Equivalences
Proposition & Predicates
Disjunctive Normal Form
Jeremy R. Johnson Wed. Sept. 29, 1999
Propositional Calculus: Boolean Functions and Expressions
Logical Inference: Through Proof to Truth
Proving Properties of Recursive List Functions
Jeremy R. Johnson Anatole D. Ruslanov William M. Mongan
Propositional Calculus: Boolean Algebra and Simplification
Discrete Mathematics CS 2610
Information Technology Department
Logic Use mathematical deduction to derive new knowledge.
Introduction to the Boolean Satisfiability Problem
CS 270 Math Foundations of CS
Introduction to the Boolean Satisfiability Problem
Disjunctive Normal Form
Computer Security: Art and Science, 2nd Edition
Chapter 7. Propositional and Predicate Logic
Presentation transcript:

Elementary Metamathematics CS 270: Math Foundation of CS Jeremy Johnson

Objective To reason about natural deduction itself (metamathematics). In particular, we show that every sequent (argument) that can be proven is true in the truth table sense (soundness) and every sequent that is true can be proven (completeness).

Outline Application of derived rules Reduce logical consequence to tautology Normal forms (NNF, DNF and CNF) Soundness (validity of rules) Completeness (any logical consequence can be proved)

Normal Forms A Boolean expression in DNF can be derived from the truth table for a Boolean function An algorithm to convert any Boolean expression into an equivalent one in DNF Equivalence of any particular Boolean expression and the one returned by this algorithm can be proven with natural deduction, but the correctness for all possible inputs requires (induction)

Disjunctive Normal Form September 4, 1997 Disjunctive Normal Form Any Boolean function can be written as a Boolean expression in DNF Disjunction of conjunction of literals Conjunction of literals defining each row. Disjunction of rows that are true E.G. (multiplexor function) s x0 x1 f 0 0 0 0 0 0 1 0 0 1 0 1 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 0 1 1 1 1 (s  x0  x1 )  (s  x0  x1 )  (s  x0  x1 )  (s  x0  x1 ) 5 5

Disjunctive Normal Form Theorem. Any boolean expression can be converted to an equivalent boolean exprssion in DNF. Proof. Any boolean expression defines a boolean function. Construct the truth table for the boolean expression and use the procedure on the previous slide to construct a boolean expression in DNF for the function defined by the truth table.

Alternative Proof A recursive conversion algorithm with corresponding inductive proof of correctness. Assume that implications and equivalences have been removed Assume that constants have been eliminated First convert to Negative Normal Form (NNF) (not expr) only occurs when expr is a variable Use DeMorgan’s Law and Double Negation Law Then convert to DNF Distribute and over or

DeMorgan’s Law (E  F)  E  F  E F    E F

Double Negation E  E   E E

NNF Example 𝑎 ⋀(𝑏∨𝑐)  a  b c 

NNF Example 𝑎 ⋀(𝑏∨𝑐) ≡ 𝑎 ∨ 𝑏∨𝑐 [DeMorgan’s Law]  a b c 

NNF Example 𝑎 ⋀(𝑏∨𝑐) ≡ 𝑎 ∨ 𝑏∨𝑐 [DeMorgan’s Law] Recursively convert operands  a b c 

NNF Example 𝑎 ⋀(𝑏∨𝑐) ≡ 𝑎 ∨ 𝑏∨𝑐 [DeMorgan’s Law] ≡𝑎 ∨ 𝑏∨𝑐 [Double Negation Law]  a b c 

NNF Example 𝑎 ⋀(𝑏∨𝑐) ≡ 𝑎 ∨ 𝑏∨𝑐 [DeMorgan’s Law] ≡𝑎 ∨ 𝑏∨𝑐 [Double Negation Law] ≡𝑎 ∨( 𝑏 ∧ 𝑐 ) [DeMorgan’s Law]  a  b c 

Conversion to NNF Define NNF(expr) Input: expr is a Boolean Expression, Output: an equivalent Boolean Expression in NNF if isConstant(expr) return expr if isVariable(expr) return expr if isNegation(expr) return NNF_Not(expr) if isDisjunction(expr) return NNF(op1(expr))  NNF(op2(expr)) if isConjunction(expr) return NNF(op1(expr))  NNF(op2(expr))

NNF_Not Define NNF_Not(expr) Input: is a Boolean Expression with expr =  expr1 Output: an equivalent Boolean Expression in NNF expr1 = op(expr) if isConstant(expr1) return expr if isVariable(expr1) return expr if isNegation(expr1) return NNF(op(expr1)) [remove double negation] if isDisjunction(expr1) return NNF( op1(expr1)  NNF( op2(expr1)) [DeMorgan’s Law] if isConjunction(expr1) return NNF( op1(expr1))  NNF( op2(expr1)) [DeMorgan’s Law]

Distribute And over Or E  (F1 F2) (E1  E2)  F (E  F1)  (E  F2)

DNF Example (𝑎∨𝑏)∧( 𝑐 ∨ 𝑑 )   𝑑 a b 𝑐

DNF Example (𝑎∨𝑏)∧( 𝑐 ∨ 𝑑 ) ≡ ((𝑎∨𝑏)∧ 𝑐 )∨((𝑎∨𝑏)∧ 𝑑 )   𝑑 𝑐 a b

DNF Example (𝑎∨𝑏)∧( 𝑐 ∨ 𝑑 ) ≡ ((𝑎∨𝑏)∧ 𝑐 )∨((𝑎∨𝑏)∧ 𝑑 ) ≡ ((𝑎∧ 𝑐 ) ∨(𝑏∧ 𝑐 ))∨((𝑎∨𝑏)∧ 𝑑 )   𝑑 a 𝑐 b

DNF Example (𝑎∨𝑏)∧( 𝑐 ∨ 𝑑 ) ≡ ((𝑎∨𝑏)∧ 𝑐 )∨((𝑎∨𝑏)∧ 𝑑 ) ≡ ((𝑎∧ 𝑐 ) ∨(𝑏∧ 𝑐 ))∨((𝑎∨𝑏)∧ 𝑑 ) ≡ ((𝑎∧ 𝑐 ) ∨(𝑏∧ 𝑐 ))∨((𝑎∧ 𝑑 ) ∨(𝑏∧ 𝑑 ))   a 𝑐 b 𝑑

Conversion to DNF Define DNF(expr) Input: expr is a Boolean Expression in NNF Output: an equivalent Boolean Expression in DNF if isConstant(expr) return expr if isVariable(expr) return expr if isNegation(expr) return expr if isDisjunction(expr) return DNF(op1(expr))  DNF(op2(expr)) if isConjunction(expr) return DistributeAndOverOr (DNF(op1(expr))  DNF(op2(expr)))

Conjunctive Normal Form September 4, 1997 Conjunctive Normal Form Conjunctive normal form (products of sums) Conjunction of clauses (disjunction of literals) Clause to preclude a false row Conjunction over all false rows Alternatively use DeMorgan’s law for the negation of dnf for f (zero rows) E.G. (multiplexor function) 𝑠  𝑥 0  𝑥 1  𝑠  𝑥 0   𝑥 1  (𝑠  𝑥 0  𝑥 1 )  (𝑠   𝑥 0  𝑥 1 ) s x0 x1 f 0 0 0 0 0 0 1 0 0 1 0 1 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 0 1 1 1 1 23 23

Conversion to CNF Define CNF(expr) Input: expr is a Boolean Expression in NNF Output: an equivalent Boolean Expression in CNF Algorithm is analogous (dual) to DNF.

DNF vs CNF It is easy to determine if a boolean expression in DNF is satisfiable but difficult to determine if it is valid It is easy to determine if a boolean expression in CNF is valid but difficult to determine if it is satisfiable It is possible to convert any boolean expression to DNF or CNF; however, there can be exponential blowup

Exponential Blowup Converting the following expression shows that an exponential increase in the size of the DNF form of a boolean expression is possible (x1  y1)    (xn  yn) (x1    xn)    (y1    yn)

Soundness and Completeness 1,…,n ⊨  holds iff 1,…,n ⊢  is valid In particular, ⊨ , a tautology, ⊢  is valid. I.E.  is a tautology iff  is provable Soundness – you can not prove things that are not true in the truth table sense Completeness – you can prove anything that is true in the truth table sense

Proof Outline For soundness show, using a truth table, that each rule of inference implies the conclusion is true when the assumptions are true and use induction on the length of the proof to chain together inferences For completeness Reduce to proving tautologies Reduce to CNF Construct proof for each clause

Correctness of Rules of Inference  …   …     e             F T

Correctness of Rules of Inference  …   i         F T

Correctness of Rules of Inference  … ⊥  i      e      F F T    F T

Proof of Completeness Reduce to tautologies 1,…,n ⊨  is equivalent to ⊨  where  = (1   n )  Convert  to * in CNF (conversion algorithm provides proof) Prove each clause in * using LEM (p1    p1) must contain pj = pi otherwise we could find an assignment that makes it false. Use assoc. and comm. to get i=1 and j=2 Combine proofs in (2) and (3)