Propositional logic. Programming and Modal Logic

Similar documents
Propositional logic. Programming and Modal Logic

Natural Deduction for Propositional Logic

Normal Forms of Propositional Logic

Propositional Logic: Deductive Proof & Natural Deduction Part 1

Symbolic Analysis. Xiangyu Zhang

15414/614 Optional Lecture 1: Propositional Logic

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

Learning Goals of CS245 Logic and Computation

Propositional Logic: Models and Proofs

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

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

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

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

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

COMP219: Artificial Intelligence. Lecture 20: Propositional Reasoning

Part 1: Propositional Logic

Advanced Topics in LP and FP

Inference in Propositional Logic

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

The Calculus of Computation: Decision Procedures with Applications to Verification. Part I: FOUNDATIONS. by Aaron Bradley Zohar Manna

Overview. I Review of natural deduction. I Soundness and completeness. I Semantics of propositional formulas. I Soundness proof. I Completeness proof.

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

Logic: Propositional Logic (Part I)

Decision Procedures for Satisfiability and Validity in Propositional Logic

Deductive Systems. Lecture - 3

CS156: The Calculus of Computation

LOGIC PROPOSITIONAL REASONING

03 Propositional Logic II

Propositional Reasoning

02 Propositional Logic

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

Propositional Logic. Methods & Tools for Software Engineering (MTSE) Fall Prof. Arie Gurfinkel

Comp487/587 - Boolean Formulas

Language of Propositional Logic

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

Introduction to Artificial Intelligence. Logical Agents

Tecniche di Verifica. Introduction to Propositional Logic

Propositional Logic Language

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

Propositional and Predicate Logic - II

Propositional Logic: Evaluating the Formulas

Knowledge based Agents

CS720 Class Notes. Steve Revilak

CS 512, Spring 2017, Handout 10 Propositional Logic: Conjunctive Normal Forms, Disjunctive Normal Forms, Horn Formulas, and other special forms

Artificial Intelligence Chapter 7: Logical Agents

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

Automated Program Verification and Testing 15414/15614 Fall 2016 Lecture 2: Propositional Logic

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

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

Logic for Computer Science - Week 4 Natural Deduction

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

Introduction to Metalogic

Logic for Computer Science - Week 5 Natural Deduction

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel

Intelligent Agents. Pınar Yolum Utrecht University

Logical Agents. Chapter 7

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

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

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

CS156: The Calculus of Computation Zohar Manna Autumn 2008

Proof Methods for Propositional Logic

Kecerdasan Buatan M. Ali Fauzi

A brief introduction to Logic. (slides from

Part 1: Propositional Logic

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

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

Inference Methods In Propositional Logic

Propositional Logic. Logic. Propositional Logic Syntax. Propositional Logic

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

(p == train arrives late) (q == there are taxis) (r == If p and not q, then r. Not r. p. Therefore, q. Propositional Logic

Class Assignment Strategies

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

Logic and Inferences

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

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

Propositional Logic: Methods of Proof (Part II)

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

Lecture 2 Propositional Logic & SAT

Propositional Resolution Introduction

Logic: Propositional Logic Truth Tables

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

3 Propositional Logic

Logical agents. Chapter 7. Chapter 7 1

Inference Methods In Propositional Logic

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

CSE507. Introduction. Computer-Aided Reasoning for Software. Emina Torlak courses.cs.washington.edu/courses/cse507/17wi/

CS 380: ARTIFICIAL INTELLIGENCE

Propositional Logic Part 1

CS1021. Why logic? Logic about inference or argument. Start from assumptions or axioms. Make deductions according to rules of reasoning.

Propositional and Predicate Logic - V

Propositional Logic: Review

Classical Propositional Logic

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

Propositional logic II.

CS250: Discrete Math for Computer Science. L6: CNF and Natural Deduction for PropCalc

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

Lecture 1: Logical Foundations

Intermediate Logic. Natural Deduction for TFL

Transcription:

Propositional logic Programming and Modal Logic 2006-2007 4

Contents Syntax of propositional logic Semantics of propositional logic Semantic entailment Natural deduction proof system Soundness and completeness Validity Conjunctive normal forms Satisfiability Horn formulas Programming and Modal Logic 2006-2007 5

Syntax of propositional logic F = (P ) ( F ) (F F ) (F F ) (F F ) P = p q r... propositional atoms p, q, r,... for describing declarative sentences such as All students have to follow the course Programming and Modal Logic 1037 is a prime number connectives Connective Symbol Alternative symbols negation disjunction conjunction & implication,, Sometimes also bi-implication (,, ) is considered as a connective. Programming and Modal Logic 2006-2007 6

Syntax of propositional logic inding priorities ( ) for reducing the number of brackets. Also outermost brackets are often omitted. Programming and Modal Logic 2006-2007 7

Semantics of propositional logic The meaning of a formula depends on The meaning of the propositional atoms (that occur in that formula) The meaning of the connectives (that occur in that formula) Programming and Modal Logic 2006-2007 8

Semantics of propositional logic The meaning of a formula depends on The meaning of the propositional atoms (that occur in that formula) a declarative sentence is either true or false captured as an assignment of truth values ( = {T, F}) to the propositional atoms a valuation v P The meaning of the connectives (that occur in that formula) the meaning of an n-ary connective is captured by a function f n usually such functions are specified by means of a truth table. A A A A A T T F T T T T F F F T F F T T F T T F F T F F T Programming and Modal Logic 2006-2007 9

Exercise Find the meaning of the formula (p q) (q r) (p r) by constructing a truth table from the subformulas. Programming and Modal Logic 2006-2007 10

Exercise Find the meaning of the formula (p q) (q r) (p r) by constructing a truth table from the subformulas. (p q) (p q) (q r) p q r p q q r p r (q r) (p r) T T T T T T T T T T F T F F F T T F T F T F T T T F F F T F F T F T T T T T T T F T F T F F T T F F T T T T T T F F F T T T T T Programming and Modal Logic 2006-2007 11

Exercise Find the meaning of the formula (p q) (q r) (p r) by constructing a truth table from the subformulas. (p q) (p q) (q r) p q r p q q r p r (q r) (p r) T T T T T T T T T T F T F F F T T F T F T F T T T F F F T F F T F T T T T T T T F T F T F F T T F F T T T T T T F F F T T T T T Formally (this is not in the book) [ ] F ((P ) ) [p ](v) = v(p) [φ ψ ](v) = f ( [φ ](v), [ψ ](v)) [ φ ](v) = f ( [φ ](v)) [φ ψ ](v) = f ( [φ ](v), [ψ ](v)) [φ ψ ](v) = f ( [φ ](v), [ψ ](v)) Programming and Modal Logic 2006-2007 12

Questions Our interest lies with the following questions Semantic entailment Many logical arguments are of the form from the assumptions φ 1,, φ n, we know ψ. This is formalised by the semantic entailment relation =. Formally, φ 1,, φ n = ψ iff for all valuations v such that [φ i ](v) = T for all 1 i n we have [ψ ](v) = T. Validity A formula φ is valid if = φ holds. Satisfiability A formula φ is satisfiable if there exists a valuation v such that [φ](v) = T. Programming and Modal Logic 2006-2007 13

Semantic entailment How to establish semantic entailment φ 1,, φ n = ψ? Option 1 Construct a truth table. If the formulas contain m different propositional atoms, the truth table contains 2 m lines! Option 2 Give a proof. Suppose that (p q) (q r). Suppose that p. Then, as p q follows from (p q) (q r), we have q. Finally, as q r follows from (p q) (q r), we have r. Thus the formula holds. Programming and Modal Logic 2006-2007 14

Semantic entailment Proof rules for inferring a conclusion ψ from a list of premises φ 1,, φ n φ 1,, φ n ψ (sequent) What is a proof of a sequent φ 1,, φ n ψ according to the book (informal definition)? Proof rules may be instantiated, i.e. consistent replacement of variables by formulas Constructing the proof is filling the gap between the premises and the conclusion by applying a suitable sequence of proof rules. Programming and Modal Logic 2006-2007 15

Natural deduction Proof rules for conjunction introduction φ ψ φ ψ i elimination φ ψ φ ψ φ e 1 ψ e 2 Programming and Modal Logic 2006-2007 16

Exercise Exercise 1.2.1 Prove (p q) r, s t q s. Programming and Modal Logic 2006-2007 17

Exercise Exercise 1.2.1 Prove (p q) r, s t q s. Linear representation 1 (p q) r premise 2 s t premise 3 p q e 1 1 4 q e 2 3 5 s e 1 2 6 q s i 4, 5 Programming and Modal Logic 2006-2007 18

Exercise Exercise 1.2.1 Prove (p q) r, s t q s. Linear representation 1 (p q) r premise 2 s t premise 3 p q e 1 1 4 q e 2 3 5 s e 1 2 6 q s i 4, 5 Tree representation (p q) r p q q e 1 e 2 q s s t s e 1 i Programming and Modal Logic 2006-2007 19

Natural deduction Proof rules for disjunction introduction φ ψ φ ψ i 1 φ ψ i 2 elimination φ ψ φ. χ χ ψ. χ e Programming and Modal Logic 2006-2007 20

Exercise Exercise 1.4.2.(q). Prove (p q) (p r) p (q r) Programming and Modal Logic 2006-2007 21

Exercise Exercise 1.4.2.(q). Prove (p q) (p r) p (q r) 1 (p q) (p r) premise 2 3 4 5 6 7 8 9 10 11 p q p q q r p (q r) p r p r q r p (q r) assumption e 1 2 e 2 2 i 1 4 i 3,5 assumption e 1 7 e 2 7 i 2 9 i 8,10 12 p (q r) e 1,2-6,7-11 Programming and Modal Logic 2006-2007 22

Natural deduction Proof rules for implication introduction φ. ψ φ ψ i elimination φ φ ψ ψ e Programming and Modal Logic 2006-2007 23

Exercise 1. Prove p q, q r p r. 2. Prove (p (q r)) (q (p r)). Programming and Modal Logic 2006-2007 24

Exercise Prove p q, q r p r Linear representation 1 p q premise 2 q r premise 3 4 5 p q r assumption e 1,3 e 2,4 6 p r i 3-5 Tree representation (assumption management more difficult) p q q p e r p r q r e i Programming and Modal Logic 2006-2007 25

Natural deduction Proof rules for negation introduction φ. φ i elimination φ φ e Example p ( p q) Programming and Modal Logic 2006-2007 26

Natural deduction Proof rules for falsum introduction there are no proof rules for the introduction of elimination e φ Proof rules for double negation elimination φ e φ Programming and Modal Logic 2006-2007 27

Natural deduction Derived rules (derivation in book) Modus Tollens introduction φ ψ ψ MT φ φ φ i eduction Ad Absurdum / Proof by contradiction φ. φ AA Law of the Excluded Middle / Tertium Non Datur φ φ LEM Programming and Modal Logic 2006-2007 29

Natural deduction Soundness of natural deduction if φ 1,, φ n ψ, then φ 1,, φ n = ψ Completeness of natural deduction if φ 1,, φ n = ψ, then φ 1,, φ n ψ Programming and Modal Logic 2006-2007 32

Deciding validity and satisfiability of propositional formulas Validity A formula φ is valid if for any valuations v, [φ](v) = T. Satisfiability A formula φ is satisfiable if there exists a valuation v such that [φ](v) = T. Programming and Modal Logic 2006-2007 33

Deciding validity and satisfiability of propositional formulas Validity A formula φ is valid if for any valuations v, [φ](v) = T. Satisfiability A formula φ is satisfiable if there exists a valuation v such that [φ](v) = T. Examples p q p (q p) p p valid? satisfiable? valid? satisfiable? valid? satisfiable? Programming and Modal Logic 2006-2007 34

Deciding validity and satisfiability of propositional formulas Validity A formula φ is valid if for any valuations v, [φ](v) = T. Satisfiability A formula φ is satisfiable if there exists a valuation v such that [φ](v) = T. Examples p q p (q p) p p satisfiable valid unsatisfiable Given a propositional formula φ, how to check whether it is valid? satisfiable? Programming and Modal Logic 2006-2007 35

Deciding validity What are the means to decide whether or not a given formula φ is valid? Use techniques for semantic entailment (e.g., natural deduction). Use a calculus for semantical equivalence to prove that φ. Transform φ into some normal form that is semantically equivalent and then apply dedicated techniques (syntactic). φ and ψ are semantically equivalent (not. φ ψ) iff φ = ψ and ψ = φ. A decision procedure for validity can be used for semantic entailment. Lemma (1.41) φ 1,, φ n = ψ iff = φ 1 (φ 2 (φ n ψ)) Programming and Modal Logic 2006-2007 36

Deciding Validity If I am wealthy, then I am happy. I am happy. Therefore, I am wealthy. If John drinks beer, he is at least 18 years old. John does not di drink kbeer. Therefore, John is not yet 18 years old. If girls areblonde, they arepopular with boys. Ugly girls are unpopular with boys. Intellectual girls are ugly. Therefore, blonde girls are not intellectual. If I study, then I will not fail basket weaving 101. If I do not play cards to often, then I will study. I failed basket weaving 101. Therefore, I played cards too often.

Deciding validity Conjunctive Normal Forms A literal is either an atom p or the negation of an atom p. A formule φ is in conjunctive normal form (CNF) if it is a conjunction of a number of disjunctions of literals only. L = P P C = L C C CNF = C CNF CNF literal clause CNF Examples p and p are in CNF; p is not in CNF; p p and (p r) ( r s) q are in CNF; (p q) q is not in CNF. Programming and Modal Logic 2006-2007 37

Deciding validity Usefulness of CNF Deciding validity of formulas in CNF is easy! C 1 C 2 C n (CNF) Each clause has to be valid. L 1 L 2 L m (C) Lemma (1.43) = L 1 L m iff there are i and j (1 i, j m) such that L i and L j are syntactically equal. Any formula be transformed into an equivalent formula in CNF! Programming and Modal Logic 2006-2007 38

Deciding validity Transformation into CNF 1. emove all occurrences of. Done by the algorithm IF Input formula Output formula without 2. Obtain a negation normal form (only atoms are negated!). N = P P (N N) (N N) P = p q r Done by the algorithm NNF 3. Apply distribution laws Done by the algorithm CNF Input formula without Output formula in NNF Input formula in NNF Output formula in CNF Therefore, CNF(NNF(IF(φ))) is in CNF and semantically equivalent with φ. Programming and Modal Logic 2006-2007 39

Deciding validity Transformation into CNF. The algorithm IF Idea Apply the following replacement until it can not be applied anymore φ ψ replace by φ ψ Inductive definition of IF IF(p) = p IF( φ) = IF(φ) IF(φ 1 φ 2 ) = IF(φ 1 ) IF(φ 2 ) IF(φ 1 φ 2 ) = IF(φ 1 ) IF(φ 2 ) IF(φ 1 φ 2 ) = IF(φ 1 ) IF(φ 2 ) Properties of IF IF is well-defined (terminates for any input) IF(φ) φ (the output of IF and the input of IF are semantically equivalent) IF(φ) is an implication-free formula for any formula φ Programming and Modal Logic 2006-2007 40

Deciding validity Transformation into CNF. The algorithm NNF Idea apply the following replacements until none can be applied anymore φ replace by φ (φ ψ) replace by φ ψ (φ ψ) replace by φ ψ Inductive definition of NNF Properties of NNF NNF(p) = p NNF( p) = p NNF( φ) = NNF(φ) NNF( (φ 1 φ 2 )) = NNF( φ 1 φ 2 ) NNF( (φ 1 φ 2 )) = NNF( φ 1 φ 2 ) NNF(φ 1 φ 2 ) = NNF(φ 1 ) NNF(φ 2 ) NNF(φ 1 φ 2 ) = NNF(φ 1 ) NNF(φ 2 ) NNF is well-defined (terminates for any input) NNF(φ) φ (the output of NNF and the input of NNF are semantically equivalent) NNF(φ) is a NNF for any implication-free formula φ Programming and Modal Logic 2006-2007 41

Deciding validity Transformation into CNF. The algorithm CNF Idea apply until no longer possible (φ 1 φ 2 ) ψ replace by (φ 1 ψ) (φ 2 ψ) φ (ψ 1 ψ 2 ) replace by (φ ψ 1 ) (φ ψ 2 ) Inductive definition of CNF CNF(p) = p CNF( p) = p CNF(φ 1 φ 2 ) = CNF(φ 1 ) CNF(φ 2 ) CNF(φ 1 φ 2 ) = D(CNF(φ 1 ), CNF(φ 2 )) Properties of CNF (and D) with D(φ 1, φ 2 ) = D(φ 11, φ 2 ) D(φ 12, φ 2 ) φ 1 = φ 11 φ 12 D(φ 1, φ 21 ) D(φ 1, φ 22 ) φ 2 = φ 21 φ 22 φ 1 φ 2 otherwise CNF and D are well-defined D(φ, ψ) φ ψ and CNF(φ) φ CNF(φ) is in CNF for any formula φ in NNF and D(φ, ψ) is in CNF for any formulas φ and ψ in CNF Programming and Modal Logic 2006-2007 42

Example Find a CNF for p q r. p q r (p q) r (p q) r ( p q) r ( p q) r ( p q) r ( p r) (q r) Programming and Modal Logic 2006-2007 43

Example Validity of ((p q) r) s. CNF?? Programming and Modal Logic 2006-2007 44

SAT Solver Finding satisfying valuations to a proposition Finding satisfying valuations to a propositional formula.

Forcing laws { negation T F F T xxx TKS F xxx FKS T

D< " " " D< D< D< Forcing laws { conjunction ^ T T T T F F F T F F F F T ^ = = = = = T T T ^ Zb = = = = = T T Other laws possible, but and ^ are adequate F ^ = = = = = F F ^ T < < < < < T +3 F F ^ Zb < < < < < T F F ^ +3T F

Using the SAT solver 1. Convert to and ^. T (p) = p T () = T () T ( ^ ) = T () ^ T ( ) T ( _ ) = (T () ^ T ( )) T (! ) = (T () ^ T ( )) Linear growth in formula size (no distributivity). 2. Translate the formula to a DAG, sharing common subterms. 3. Set the root to T and apply the forcing rules. Satisable if all nodes are consistently annotated.

Example satisability Formula p ^ (q _ p) p ^ (q ^ p) 1T ^ S SSSSSSSSS 5T 2T 3F ^ 4T 5T 2T p o ooo o ooo o ooo q 6T o o 6F Satisable?

Example satisability Formula p ^ (q _ p) p ^ (q ^ p) 1T ^ S SSSSSSSSS 5T 2T 3F ^ 4T 5T 2T p o ooo o ooo o ooo q 6T o o 6T Satisable?

Example satisability Formula p ^ (q _ p) p ^ (q ^ p) 1T ^ S SSSSSSSSS 5T 2T 3F ^ 4T 5T 2T p o ooo o ooo o ooo q 6T o o 6T Satisable?

Example satisability Formula p ^ (q _ p) p ^ (q ^ p) 1T ^ S SSSSSSSSS 5T 2T 3F ^ 4T 5T 2T p o ooo o ooo o ooo q 6T o o 6T Satisable?

Example satisability Formula p ^ (q _ p) p ^ (q ^ p) 1T ^ S SSSSSSSSS 5T 2T 3F ^ 4T 5T 2T p o ooo o ooo o ooo q 6T o o 6T Satisable?

Example satisability Formula p ^ (q _ p) p ^ (q ^ p) 1T ^ S SSSSSSSSS 5T 2T 3F ^ 4T 5T 2T p o ooo o ooo o ooo q 6F o o 6F Satisable?

Example satisability Formula p ^ (q _ p) p ^ (q ^ p) 1T ^ S SSSSSSSSS 5T 2T 3F ^ 4T 5T 2T p o ooo o ooo o ooo q 6F o o 6F Satisable?

Example validity Formula (p _ (p ^ q))! p Valid if ((p _ (p ^ q))! p) is not satisable Translated formula (p ^ (p ^ q)) ^ p ^J J1T J J J 2T ^3F q 2T qqqq 4F 3F p p ppp p ppp p ^ 5T q Contradiction.

Example validity Formula (p _ (p ^ q))! p Valid if ((p _ (p ^ q))! p) is not satisable Translated formula (p ^ (p ^ q)) ^ p ^J J1T J J J 2T ^3F q 2T qqqq 4F 3F p p ppp p ppp p ^ 5T q Contradiction.

Example validity Formula (p _ (p ^ q))! p Valid if ((p _ (p ^ q))! p) is not satisable Translated formula (p ^ (p ^ q)) ^ p ^J J1T J J J 2T ^3F q 2T qqqq 4F 3F p p ppp p ppp p ^ 5T q Contradiction.

Example validity Formula (p _ (p ^ q))! p Valid if ((p _ (p ^ q))! p) is not satisable Translated formula (p ^ (p ^ q)) ^ p ^J J1T J J J 2T ^3F q 2T qqqq 4F 3F p p ppp p ppp p ^ 5T q Contradiction.

Example validity Formula (p _ (p ^ q))! p Valid if ((p _ (p ^ q))! p) is not satisable Translated formula (p ^ (p ^ q)) ^ p ^J J1T J J J 2T ^3F q 2T qqqq 4F 3F p p ppp p ppp p ^ 5T q Contradiction.

Example validity Formula (p _ (p ^ q))! p Valid if ((p _ (p ^ q))! p) is not satisable Translated formula (p ^ (p ^ q)) ^ p ^J J1T J J J 2T ^3F q 2T qqqq 4F 3F p p ppp p ppp p ^ 5T q Contradiction.

Example validity Formula (p _ (p ^ q))! p Valid if ((p _ (p ^ q))! p) is not satisable Translated formula (p ^ (p ^ q)) ^ p ^J J1T J J J 2T ^3F q 2T qqqq 4F 3F p p ppp p ppp p ^ 5T q Contradiction.

Example satisability Formula (p _ (p ^ q))! p ((p ^ (p ^ q)) ^ p) Now what? 1T ^J2F J J ^ q qqqq ^ p J J p ppp p ppp p q

Example satisability Formula (p _ (p ^ q))! p ((p ^ (p ^ q)) ^ p) Now what? 1T ^J2F J J ^ q qqqq ^ p J J p ppp p ppp p q

Example satisability Formula (p _ (p ^ q))! p ((p ^ (p ^ q)) ^ p) Now what? 1T 2F ^J J J J J ^ q qqqq ^ p p ppp p ppp p q

Example satisability Formula (p _ (p ^ q))! p ((p ^ (p ^ q)) ^ p) Now what? 1T 2F ^J J J J J ^ q qqqq ^ p p ppp p ppp p q

Limitation of the SAT solver algorithm Fails for all formulas of the form ( 1 ^ 2 ). T ^ F 1? 2? Some are valid, and thus satisable > p! p (p ^ p) Some are not valid, and thus not satisable? > (> ^ >) (p! p ^ p! p) ((p ^ p) ^ (p ^ p))

Limitation of the SAT solver algorithm Fails for all formulas of the form ( 1 ^ 2 ). T ^ F 1? 2? Some are valid, and thus satisable > p! p (p ^ p) Some are not valid, and thus not satisable? > (> ^ >) (p! p ^ p! p) ((p ^ p) ^ (p ^ p))

Limitation of the SAT solver algorithm Fails for all formulas of the form ( 1 ^ 2 ). T ^ F 1? 2? Some are valid, and thus satisable > p! p (p ^ p) Some are not valid, and thus not satisable? > (> ^ >) (p! p ^ p! p) ((p ^ p) ^ (p ^ p))

Limitation of the SAT solver algorithm Fails for all formulas of the form ( 1 ^ 2 ). T ^ F 1? 2? Some are valid, and thus satisable > p! p (p ^ p) Some are not valid, and thus not satisable? > (> ^ >) (p! p ^ p! p) ((p ^ p) ^ (p ^ p))

Limitation of the SAT solver algorithm Fails for all formulas of the form ( 1 ^ 2 ). T ^ F 1? 2? Some are valid, and thus satisable > p! p (p ^ p) Some are not valid, and thus not satisable? > (> ^ >) (p! p ^ p! p) ((p ^ p) ^ (p ^ p))

Limitation of the SAT solver algorithm Fails for all formulas of the form ( 1 ^ 2 ). T ^ F 1? 2? Some are valid, and thus satisable > p! p (p ^ p) Some are not valid, and thus not satisable? > (>^>) (p! p ^ p! p) ((p ^ p) ^ (p ^ p))

Limitation of the SAT solver algorithm Fails for all formulas of the form ( 1 ^ 2 ). T ^ F 1? 2? Some are valid, and thus satisable > p! p (p ^ p) Some are not valid, and thus not satisable? > (>^>) (p! p^p! p) ((p ^ p) ^ (p ^ p))

Limitation of the SAT solver algorithm Fails for all formulas of the form ( 1 ^ 2 ). T ^ F 1? 2? Some are valid, and thus satisable > p! p (p ^ p) Some are not valid, and thus not satisable? > (>^>) (p! p^p! p) ((p^p)^(p^p))

Extending the algorithm Formula (q ^ r) ^ ((q ^ r) ^ (q ^ r)) 2T ^ 1T llllll W WWWWWWWWW l W 2T 3F ^ ^ 3F 8F q l l l 6T 7T r 6T 4T llll 4F 5F 5F^ 5T 6T ^ 8F q 6T 7T r 6T 7T 7T r 6T 8F q 6T Idea pick a node and try both possibilities

Extending the algorithm Formula (q ^ r) ^ ((q ^ r) ^ (q ^ r)) 2T ^ 1T llllll W WWWWWWWWW l W 2T 3F ^ ^ 3F 8F q l l l 6T 7T r 6T 4T llll 4F 5F 5F^ 5T 6T ^ 8F q 6T 7T r 6T 7T 7T r 6T 8F q 6T Idea pick a node and try both possibilities

Extending the algorithm Formula (q ^ r) ^ ((q ^ r) ^ (q ^ r)) 2T ^ 1T llllll W WWWWWWWWW l W 2T 3F ^ ^ 3F 8F q l l l 6T 7T r 6T 4T llll 4F 5F 5F^ 5T 6T ^ 8F q 6T 7T r 6T 7T 7T r 6T 8F q 6T Idea pick a node and try both possibilities

Extending the algorithm Formula (q ^ r) ^ ((q ^ r) ^ (q ^ r)) 2T ^ 1T llllll W WWWWWWWWW l W 2T 3F ^ ^ 3F 8F q l l l 6T 7T r 6T 4T llll 4F 5F 5F^ 5T 6T ^ 8F q 6T 7T r 6T 7T 7T r 6T 8F q 6T Idea pick a node and try both possibilities

Extending the algorithm Formula (q ^ r) ^ ((q ^ r) ^ (q ^ r)) 2T ^ 1T llllll W WWWWWWWWW l W 2T 3F ^ ^ 3F 8F q l l l 6T 7T r 6T 4T llll 4F 5F 5F^ 5T 6T ^ 8F q 6T 7T r 6T 7T 7T r 6T 8F q 6T Idea pick a node and try both possibilities

Extending the algorithm Formula (q ^ r) ^ ((q ^ r) ^ (q ^ r)) 2T ^ 1T llllll W WWWWWWWWW l W 2T 3F ^ ^ 3F 8F q l l l 6T 7T r 6T 4T llll 4F 5F 5F^ 5T 6T ^ 8F q 6T 7T r 6T 7T 7T r 6T 8F q 6T r is true in both casesidea pick a node and try both possibilities

Using the value of r Formula (q ^ r) ^ ((q ^ r) ^ (q ^ r)) 2T q ^ 3F ^ 1T llllll W WWWWWWWWW l W 2T ^ 3F l l l llll 5F r 4T 7T 8F ^ 6F 5F q r 4T 6T 5F q ^ 7T r 4T Idea pick a node and try both possibilities

Using the value of r Formula (q ^ r) ^ ((q ^ r) ^ (q ^ r)) 2T q ^ 3F ^ 1T llllll W WWWWWWWWW l W 2T ^ 3F l l l llll 5F r 4T 7T 8F ^ 6F 5F q r 4T 6T 5F q ^ 7T r 4T Idea pick a node and try both possibilities

Using the value of r Formula (q ^ r) ^ ((q ^ r) ^ (q ^ r)) 2T q ^ 3F ^ 1T llllll W WWWWWWWWW l W 2T ^ 3F l l l llll 5F r 4T 7T 8F ^ 6F 5F q r 4T 6T 5F q ^ 7T r 4T Idea pick a node and try both possibilities

Using the value of r Formula (q ^ r) ^ ((q ^ r) ^ (q ^ r)) 2T q ^ 3F ^ 1T llllll W WWWWWWWWW l W 2T ^ 3F l l l llll 5F r 4T 7T 8F ^ 6F 5F q r 4T 6T 5F q ^ 7T r 4T Idea pick a node and try both possibilities

Using the value of r Formula (q ^ r) ^ ((q ^ r) ^ (q ^ r)) 2T q ^ 3F ^ 1T llllll W WWWWWWWWW l W 2T ^ 3F l l l llll 5F r 4T 7T 8F ^ 6F 5F q r 4T 6T 5F q ^ 7T r 4T Satisable.Idea pick a node and try both possibilities

Extended algorithm Algorithm 1. Pick an unmarked node and add temporary T and F marks. 2. Use the forcing rules to propagate both marks. 3. If both marks lead to a contradiction, report a contradiction. 4. If both marks lead to some node having the same value, permanently assign the node that value. 5. Erase the remaining temporary marks and continue. Complexity O(n 3 ) 1. Testing each unmarked node O(n) 2. Testing a given unmarked node O(n) 3. epeating the whole thing when a new node is marked O(n) Why isn't it exponential?

An optimization Formula (q ^ r) ^ ((q ^ r) ^ (q ^ r)) 2T ^ 1T llllll W WWWWWWWWW l W 2T 3F ^ ^ 3F 8F q l l l 6T 7T r 6T 4T llll 4F 5F 5F^ 5T 6T ^ 8F q 6T 7T r 6T 7T 7T r 6T 8F q 6T We could stop here red values give a complete and consistent valuation.

Another optimization 2T ^ 1T llllll W WWWWWWWWW l W 2T 3F ^ ^ 3F 8F q l l l 6T 7T r 6T 4T llll 4F 5F 5F^ 5T 6T ^ 8F q 6T 7T r 6T 7T 7T r 6T 8F q 6T I Contradiction in the leftmost subtree. I No need to analyze q, etc. I Permanently mark \4T4F" as T.