Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Propositional Proof Systems SS 2010 Quantified Boolean Formulas Uwe Bubeck University of Paderborn 11.6.2010 Outline • Introduction • Syntax and Semantics • Normal Forms Literature H. Kleine Büning, T. Lettmann, Propositional Logic: Deduction and Algorithms, Cambridge University Press 1999 Uwe Bubeck Quantified Boolean Formulas 2 Quantified Boolean Formulas Introduction Informal Introduction 1/2 Quantified Boolean Formulas: propositional formulas with additional quantifiers over atoms Uwe Bubeck Quantified Boolean Formulas 4 Informal Introduction 2/2 Informal QBF Semantics: ∀x φ(x) is true if and only if φ[x/0] is true and φ[x/1] is true ∃x φ(x) is true if and only if φ[x/0] is true or φ[x/1] is true Uwe Bubeck Quantified Boolean Formulas 5 Verification and QBF 1/3 Interesting application example: Bounded Model Checking Idea: state transition graph of a system is checked for reachable bad states. s4 r Are all reachable states with r always followed by states with q (r → X q) ? s2 q s0 Uwe Bubeck s3 p,r p Quantified Boolean Formulas s1 q,r 6 Verification and QBF 1/3 Interesting application example: Bounded Model Checking Idea: state transition graph of a system is checked for reachable bad states. s4 r Are all reachable states with r always followed by states with q (r → X q) ? No, there is a path to the bad state s3 ! Uwe Bubeck s3 p,r s2 q s0 p Quantified Boolean Formulas s1 q,r 7 Verification and QBF 2/3 Problem: state space explosion Idea: symbolic encoding for paths of fixed length k z0 z1 z2 z3 Remaining Problem: many copies of δ Improvement: logic which allows abbreviations Uwe Bubeck Quantified Boolean Formulas 8 Verification and QBF 3/3 Even more compact: iterative squaring zk z0 z0 ∃z‘ ∀u‘ ∃z‘ ∀v‘ zk → prefix ∃∀∀∃∀∀... Uwe Bubeck Quantified Boolean Formulas 9 Quantified Boolean Formulas Syntax and Semantics QBF Syntax 1/2 Definition The set of quantified Boolean formulas is inductively defined as follows: 1. Propositional formulas and Boolean constants are quantified Boolean formulas. 2. If Φ is a quantified Boolean formula and x a variable, ∃x Φ and ∀x Φ are quantified Boolean formulas. 3. If Φ1 and Φ2 are quantified Boolean formulas, ¬Φ1, Φ1∨Φ2 and Φ1∧Φ2 are quantified Boolean formulas. Uwe Bubeck Quantified Boolean Formulas 11 QBF Syntax 2/2 Further Definitions and Notation • universally quantified variables are usually named x1,...,xn. • existentially quantified variables are usually y1,...,ym. • variables which are not in the scope of a quantifier are called free variables and typically named z1,...,zr. • a formula without free variables is said to be closed. • QBF is the class of closed quantified Boolean formulas. • QBF* is the class of QBF formulas with free variables. Uwe Bubeck Quantified Boolean Formulas 12 Evaluating QBFs 1/2 Definition Let Φ be a QBF* formula with free variables z1,...,zr. Then a truth assignment ℑ is a mapping ℑ:{z1,...,zr} → {0,1} which satisfies the following conditions: Uwe Bubeck Quantified Boolean Formulas 13 Evaluating QBFs 2/2 Observations • a closed formula is either true or false. • the truth of a QBF* formula depends on the values of the free variables. A QBF* formula Φ is called satisfiable if and only if there exists a truth assignment ℑ to the free variables such that ℑ(Φ) = 1, and unsatisfiable otherwise. Uwe Bubeck Quantified Boolean Formulas 14 Use of free Variables Why do we need free variables? Given: propositional formula φ(z1,...,zr) Wanted: shorter QBF* Φ(z1,...,zr) with free variables z1,...,zr such that ℑΦ(z1,...,zr) = ℑφ(z1,...,zr) („equivalence“) Example: (A ∨ ¬B ∨ C ∨ D) ∧ (A ∨ ¬B ∨ C ∨ ¬E) ∧ (A ∨ ¬B ∨ C ∨ F) Uwe Bubeck Quantified Boolean Formulas 15 Use of free Variables Why do we need free variables? Given: propositional formula φ(z1,...,zr) Wanted: shorter QBF* Φ(z1,...,zr) with free variables z1,...,zr such that ℑΦ(z1,...,zr) = ℑφ(z1,...,zr) („equivalence“) Example: (A ∨ ¬B ∨ C ∨ D) ∧ (A ∨ ¬B ∨ C ∨ ¬E) ∧ (A ∨ ¬B ∨ C ∨ F) ≈ ∃y (y → (A ∨ ¬B ∨ C) ∧ (y ∨ D) ∧ (y ∨ ¬E) ∧ (y ∨ F) Uwe Bubeck Quantified Boolean Formulas 16 Consequence and Equivalence Definition A QBF* formula Φ2 is a consequence of Φ1 (Φ1 |= Φ2) if and only if for all truth assignments ℑ we have ℑ(Φ1) = 1 → ℑ(Φ2) = 1. Φ1 is logically equivalent to Φ2 (Φ1 ≈ Φ2) if and only if Φ1 |= Φ2 and Φ2 |= Φ1. Observation For consequence and equivalence, quantified variables are not directly taken into account. They can be seen as local within the respective formula. Uwe Bubeck Quantified Boolean Formulas 17 Quantified Boolean Formulas Normal Forms Prenex Formulas 1/2 The syntax definition of QBF* allows quantifiers within the whole formula. Example: Φ = (∀x ∃y φ(x,y)) ∨ (∀x ∃z ψ(x,z)) Problem: difficult to handle such formulas Solution: It is usually assumed to have prenex formulas where all quantifiers are at the beginning: Φ = Q1v1...Qkvk φ(v1,...,vk,zz) Prefix Uwe Bubeck Matrix (purely propositional) Quantified Boolean Formulas 19 Prenex Formulas 2/2 Every QBF* formula can be transformed into a prenex formula of linear length with these steps: 1. Renaming of quantified variables to avoid different quantifiers over the same variables or free and quantified occurrences of a variable. 2. Transformation into Negation Normal Form (NNF) with De Morgan‘s laws and the negation law, plus the equivalences ¬(∃v φ) ≈ ∀v ¬φ and ¬(∀v φ) ≈ ∃v ¬φ. 3. Moving quantifiers to the front. Uwe Bubeck Quantified Boolean Formulas 20 Transformations on the Matrix Lemma Let Q be a prefix and Φ1 and Φ2 two QBF* formulas. Then Φ1 ≈ Φ2 ⇒ QΦ1 ≈ QΦ2. Application Propositional equivalences can be applied to the matrix of a QBF*. This allows the transformation of QBF* formulas into equivalent quantified CNF (QCNF*) of linear length. Uwe Bubeck Quantified Boolean Formulas 21 Simplifications A QBF* formula Φ can be simplified as follows: • If Φ is not a tautology, delete all tautological clauses. • If Φ contains a non-tautological clause with only universal variables, the formula is unsatisfiable. • Universal Reduction: from a non-tautological clause, we can delete a literal over a universal x if no existentially quantified variable yi in the same clause is in the scope of ∀x. • Pure Literal Detection: delete all clauses containing pure existential variables and all literals over pure universal variables. Uwe Bubeck Quantified Boolean Formulas 22