Quantified Boolean formulas #
Quantified Boolean formulas over an arbitrary type V of variables: variables, the two constants,
negation, conjunction, disjunction, and quantifiers ∃ v and ∀ v over the truth value of a
variable Stockmeyer and Meyer. QBF.eval σ φ is the truth value of φ
under the assignment σ; a quantifier over v evaluates its body with v set to each of the two
truth values (Function.update).
The value of a formula depends only on its free variables (QBF.eval_congr), so a closed formula,
one without free variables, has the same value under every assignment (QBF.eval_eq_of_closed).
The true closed formulas form the problem TQBF, which is PSPACE-complete Arora and Barak,
Section 4.2 (Cslib.Complexity.TQBF_pspaceComplete).
cslib's Cslib.Logic.PL.Proposition has no quantifiers and is a syntax for proof systems rather
than an evaluated one, so it is not reused.
Main definitions #
Cslib.Logic.PL.QBF: the formulas.Cslib.Logic.PL.QBF.eval: the value of a formula under an assignment.Cslib.Logic.PL.QBF.freeVars,Cslib.Logic.PL.QBF.Closed.Cslib.Logic.PL.QBF.vars,Cslib.Logic.PL.QBF.size: the variables, free or bound, and the number of nodes.Cslib.Logic.PL.QBF.exs,Cslib.Logic.PL.QBF.alls,Cslib.Logic.PL.QBF.conj,Cslib.Logic.PL.QBF.imp,Cslib.Logic.PL.QBF.iff,Cslib.Logic.PL.QBF.lit: derived connectives, blocks of quantifiers and conjunctions of lists.Cslib.Logic.PL.QBF.ofClause,Cslib.Logic.PL.QBF.ofCNF: clauses and formulas in conjunctive normal form as quantified Boolean formulas.
Main results #
Cslib.Logic.PL.QBF.eval_ex_eq_true_iff,Cslib.Logic.PL.QBF.eval_all_eq_true_iff: the quantifiers as∃and∀over a truth value.Cslib.Logic.PL.QBF.eval_congr: the value depends only on the free variables.Cslib.Logic.PL.QBF.eval_eq_of_closed: a closed formula has the same value under every assignment.Cslib.Logic.PL.QBF.eval_not_ex,Cslib.Logic.PL.QBF.eval_not_all: De Morgan's laws for the quantifiers.Cslib.Logic.PL.QBF.eval_exs_eq_true_iff,Cslib.Logic.PL.QBF.eval_alls_eq_true_iff: blocks of quantifiers range over the assignments that agree outside the block.Cslib.Logic.PL.QBF.eval_ofCNF,Cslib.Logic.PL.QBF.mem_freeVars_ofCNF: formulas in conjunctive normal form keep their value and their variables.
References #
Quantified Boolean formulas over variables of type V.
- var {V : Type u_1} (v : V) : QBF V
The variable
v. - top {V : Type u_1} : QBF V
The constant true.
- bot {V : Type u_1} : QBF V
The constant false.
- not {V : Type u_1} (φ : QBF V) : QBF V
Negation.
- and {V : Type u_1} (φ ψ : QBF V) : QBF V
Conjunction.
- or {V : Type u_1} (φ ψ : QBF V) : QBF V
Disjunction.
- ex {V : Type u_1} (v : V) (φ : QBF V) : QBF V
Existential quantification
∃ v, φover the truth value ofv. - all {V : Type u_1} (v : V) (φ : QBF V) : QBF V
Universal quantification
∀ v, φover the truth value ofv.
Instances For
Instances For
Evaluation #
Free variables #
The free variables of a formula: the variables with an occurrence outside the scope of every quantifier over them.
Instances For
Updating a variable that is not free does not change the value of a formula.
Variables and size #
The variables of a formula, free or bound, with multiplicity, in prefix order.
Instances For
The number of nodes of a formula.
Instances For
Closed formulas #
A formula is closed when it has no free variables.
Instances For
A closed formula has the same value under every assignment.
Derived connectives #
The literal of v with sign b: v itself for true, its negation for false.
Instances For
A block of existential quantifiers ranges over the assignments that agree with the given one outside the block.
A block of universal quantifiers ranges over the assignments that agree with the given one outside the block.
A formula in conjunctive normal form keeps its value.