QSAT: quantified Boolean formulas with an unbounded prefix #
The vocabulary and semantics of the canonical PSPACE-complete problem
(DescriptiveComplexity.QSAT, also known as TQBF or QBF): is a fully quantified
Boolean formula in prenex conjunctive normal form true? Unlike the bounded
families DescriptiveComplexity.QBF k of DescriptiveComplexity.Problems.Qbf – where the
number of alternations is fixed by the problem and only the matrix comes
with the instance – here the quantifier prefix is part of the instance, so a
single problem carries arbitrarily many alternations. That is exactly the step
from the polynomial hierarchy to PSPACE.
The instance #
An instance is a FirstOrder.Language.qsat-structure. As in
FirstOrder.Language.sat, its elements are propositional variables and clauses
at once, with
isVar x: the elementxis a quantified propositional variable;allVar x: the variablexis quantified universally (existentially otherwise);prefixLt x y: the variablexis quantified outside the variabley;isClause c,posIn c x,negIn c x: the clauses of the matrix and the literal occurrences, exactly as for SAT.
An instance is well formed (DescriptiveComplexity.QsatWf) when prefixLt is a
strict linear order on the marked variables; a malformed instance is a
no-instance. Well-formedness is a first-order condition, which is what lets the
membership proof check it inside the walk.
The semantics #
Reading a quantifier prefix means recursing along prefixLt, and the recursion
is over a set of remaining variables rather than over a syntactic list. It is
packaged as an inductive predicate DescriptiveComplexity.QsatWins: a position is a
pair (D, τ) of a set D of already-quantified variables and a valuation τ,
and QsatWins D τ says that the existential player wins the game that
quantifies the variables outside D, innermost-first, and ends in the matrix.
An inductive definition is used rather than a recursion so that the semantics
is available on an arbitrary (possibly infinite) structure, as
DescriptiveComplexity.DecisionProblem requires; on a finite well-formed structure it is
the usual game value, since the three rules are then mutually exclusive and
exhaustive (DescriptiveComplexity.qsatWins_all_iff,
DescriptiveComplexity.qsatWins_ex_iff, DescriptiveComplexity.qsatWins_leaf_iff, proved by
inversion alone).
The quantified variable at a position is the prefixLt-least one not yet in
D (DescriptiveComplexity.QLeast), so the prefix is read outermost-first and the
players move in the order the instance prescribes.
Relation symbols of the language of fully quantified Boolean formulas with an unbounded quantifier prefix.
- isVar : qsatRel 1
isVar x: the elementxis a quantified propositional variable. - allVar : qsatRel 1
allVar x: the variablexis quantified universally. - prefixLt : qsatRel 2
prefixLt x y: the variablexis quantified outside the variabley. - isClause : qsatRel 1
isClause c: the elementcis a clause of the matrix. - posIn : qsatRel 2
posIn c x: the variablexoccurs positively in the clausec. - negIn : qsatRel 2
negIn c x: the variablexoccurs negatively in the clausec.
Instances For
Dependency graph
Equations
- FirstOrder.Language.instDecidableEqQsatRel.decEq FirstOrder.Language.qsatRel.isVar FirstOrder.Language.qsatRel.isVar = isTrue FirstOrder.Language.instDecidableEqQsatRel.decEq._proof_1
- FirstOrder.Language.instDecidableEqQsatRel.decEq FirstOrder.Language.qsatRel.isVar FirstOrder.Language.qsatRel.allVar = isFalse FirstOrder.Language.instDecidableEqQsatRel.decEq._proof_2
- FirstOrder.Language.instDecidableEqQsatRel.decEq FirstOrder.Language.qsatRel.isVar FirstOrder.Language.qsatRel.isClause = isFalse FirstOrder.Language.instDecidableEqQsatRel.decEq._proof_3
- FirstOrder.Language.instDecidableEqQsatRel.decEq FirstOrder.Language.qsatRel.allVar FirstOrder.Language.qsatRel.isVar = isFalse FirstOrder.Language.instDecidableEqQsatRel.decEq._proof_4
- FirstOrder.Language.instDecidableEqQsatRel.decEq FirstOrder.Language.qsatRel.allVar FirstOrder.Language.qsatRel.allVar = isTrue FirstOrder.Language.instDecidableEqQsatRel.decEq._proof_5
- FirstOrder.Language.instDecidableEqQsatRel.decEq FirstOrder.Language.qsatRel.allVar FirstOrder.Language.qsatRel.isClause = isFalse FirstOrder.Language.instDecidableEqQsatRel.decEq._proof_6
- FirstOrder.Language.instDecidableEqQsatRel.decEq FirstOrder.Language.qsatRel.prefixLt FirstOrder.Language.qsatRel.prefixLt = isTrue FirstOrder.Language.instDecidableEqQsatRel.decEq._proof_7
- FirstOrder.Language.instDecidableEqQsatRel.decEq FirstOrder.Language.qsatRel.prefixLt FirstOrder.Language.qsatRel.posIn = isFalse FirstOrder.Language.instDecidableEqQsatRel.decEq._proof_8
- FirstOrder.Language.instDecidableEqQsatRel.decEq FirstOrder.Language.qsatRel.prefixLt FirstOrder.Language.qsatRel.negIn = isFalse FirstOrder.Language.instDecidableEqQsatRel.decEq._proof_9
- FirstOrder.Language.instDecidableEqQsatRel.decEq FirstOrder.Language.qsatRel.isClause FirstOrder.Language.qsatRel.isVar = isFalse FirstOrder.Language.instDecidableEqQsatRel.decEq._proof_10
- FirstOrder.Language.instDecidableEqQsatRel.decEq FirstOrder.Language.qsatRel.isClause FirstOrder.Language.qsatRel.allVar = isFalse FirstOrder.Language.instDecidableEqQsatRel.decEq._proof_11
- FirstOrder.Language.instDecidableEqQsatRel.decEq FirstOrder.Language.qsatRel.isClause FirstOrder.Language.qsatRel.isClause = isTrue FirstOrder.Language.instDecidableEqQsatRel.decEq._proof_12
- FirstOrder.Language.instDecidableEqQsatRel.decEq FirstOrder.Language.qsatRel.posIn FirstOrder.Language.qsatRel.prefixLt = isFalse FirstOrder.Language.instDecidableEqQsatRel.decEq._proof_13
- FirstOrder.Language.instDecidableEqQsatRel.decEq FirstOrder.Language.qsatRel.posIn FirstOrder.Language.qsatRel.posIn = isTrue FirstOrder.Language.instDecidableEqQsatRel.decEq._proof_14
- FirstOrder.Language.instDecidableEqQsatRel.decEq FirstOrder.Language.qsatRel.posIn FirstOrder.Language.qsatRel.negIn = isFalse FirstOrder.Language.instDecidableEqQsatRel.decEq._proof_15
- FirstOrder.Language.instDecidableEqQsatRel.decEq FirstOrder.Language.qsatRel.negIn FirstOrder.Language.qsatRel.prefixLt = isFalse FirstOrder.Language.instDecidableEqQsatRel.decEq._proof_16
- FirstOrder.Language.instDecidableEqQsatRel.decEq FirstOrder.Language.qsatRel.negIn FirstOrder.Language.qsatRel.posIn = isFalse FirstOrder.Language.instDecidableEqQsatRel.decEq._proof_17
- FirstOrder.Language.instDecidableEqQsatRel.decEq FirstOrder.Language.qsatRel.negIn FirstOrder.Language.qsatRel.negIn = isTrue FirstOrder.Language.instDecidableEqQsatRel.decEq._proof_18
Instances For
Dependency graph
Dependency graph
The relational vocabulary of fully quantified Boolean formulas: that of CNF instances, together with the marks and the order describing the quantifier prefix.
Equations
- FirstOrder.Language.qsat = { Functions := fun (x : ℕ) => Empty, Relations := FirstOrder.Language.qsatRel }
Instances For
Dependency graph
Dependency graph
The symbol for “is a quantified variable”.
Instances For
Dependency graph
The symbol for “is universally quantified”.
Instances For
Dependency graph
The symbol for “is quantified outside”.
Instances For
Dependency graph
The symbol for “is a clause”.
Instances For
Dependency graph
The symbol for “occurs positively in”.
Instances For
Dependency graph
The symbol for “occurs negatively in”.
Instances For
Dependency graph
Reading an instance #
The element x is a quantified propositional variable.
Equations
Instances For
Dependency graph
The variable x is quantified universally.
Equations
Instances For
Dependency graph
The variable x is quantified outside the variable y.
Equations
Instances For
Dependency graph
An instance is well formed when the quantifier prefix is a strict linear order on the marked variables. Malformed instances are no-instances; the condition is first-order, so the membership proof can check it.
The prefix order only relates quantified variables.
The prefix order is irreflexive.
The prefix order is transitive.
The prefix order is total on the quantified variables.
Instances For
Dependency graph
The matrix: every clause contains a literal on a quantified variable that
the valuation τ makes true. Elements that are not clauses impose nothing,
exactly as in DescriptiveComplexity.Satisfiable; an occurrence on an element that the
prefix does not quantify is not a literal, so the matrix depends on τ only
through its values on the variables.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The matrix only depends on the valuation through its values on the quantified variables.
Dependency graph
Adding a variable to the set of already-quantified ones.
Equations
- DescriptiveComplexity.qAdd D x y = (y = x ∨ D y)
Instances For
Dependency graph
Giving the value b to the variable x in the valuation τ.
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
The variable x is the one the position D quantifies next: it is the
prefixLt-least variable that D does not contain.
Equations
- DescriptiveComplexity.QLeast D x = (DescriptiveComplexity.IsQVar x ∧ ¬D x ∧ ∀ (y : A), DescriptiveComplexity.IsQVar y → ¬D y → ¬DescriptiveComplexity.QPrec y x)
Instances For
Dependency graph
The next variable to quantify is unique, by totality of the prefix order.
Dependency graph
The game #
QsatWins D τ is the value of the position in which the variables of D have
already been given their values by τ and the remaining ones are still to be
quantified, innermost-first along the prefix order.
The quantifier game: the existential player wins the position (D, τ).
Either every variable is already quantified and the matrix holds, or the next
variable is existential and one of its two values wins, or it is universal and
both of its values win.
- leaf
{A : Type}
[FirstOrder.Language.qsat.Structure A]
{D τ : A → Prop}
(hD : ∀ (x : A), IsQVar x → D x)
(hm : QsatMatrix τ)
: QsatWins D τ
Every variable has been quantified: the position is won exactly when the matrix holds.
- ex
{A : Type}
[FirstOrder.Language.qsat.Structure A]
{D τ : A → Prop}
{x : A}
(hx : QLeast D x)
(hq : ¬IsQAll x)
(b : Bool)
(h : QsatWins (qAdd D x) (qUpd τ x b))
: QsatWins D τ
The next variable is existential: the existential player picks a value winning the rest of the game.
- all
{A : Type}
[FirstOrder.Language.qsat.Structure A]
{D τ : A → Prop}
{x : A}
(hx : QLeast D x)
(hq : IsQAll x)
(h : ∀ (b : Bool), QsatWins (qAdd D x) (qUpd τ x b))
: QsatWins D τ
The next variable is universal: both values must win the rest of the game.
Instances For
Dependency graph
A position only depends on the values already given: two valuations
agreeing on the quantified part D win the same positions. This is what makes
(D, τ) a position rather than a full state: the values of τ outside D are
about to be overwritten by the quantifiers.
Dependency graph
The three rules read backwards #
Together with DescriptiveComplexity.QLeast.unique the constructors are
mutually exclusive, so each of them is an equivalence: the inductive predicate
is the game value, and no induction is needed to see it.
At a position where every variable is quantified, winning is satisfying the matrix.
Dependency graph
At a position whose next variable is existential, winning is winning after one of its two values.
Dependency graph
At a position whose next variable is universal, winning is winning after both of its values.
Dependency graph
Isomorphism-invariance #
The decision problem #
The yes-instances of QSAT: a well-formed instance whose quantified formula is true, i.e. whose initial position – nothing quantified yet, the empty valuation – is won by the existential player.
Equations
- DescriptiveComplexity.QsatHolds A = (DescriptiveComplexity.QsatWf A ∧ DescriptiveComplexity.QsatWins (fun (x : A) => False) fun (x : A) => False)
Instances For
Dependency graph
QSAT, as a problem on FirstOrder.Language.qsat-structures: is the fully
quantified Boolean formula described by the instance true?
Equations
- One or more equations did not get rendered due to their size.