Documentation

CslibFrontier.Computability.Complexity.Problems.TQBF.QuantifierFree

Quantifier-free Boolean formulas and their polynomial-time evaluation #

QBF.QuantifierFree identifies Boolean formulas within the existing QBF syntax. A scan of the prefix tokens from right to left evaluates such formulas with a stack of truth values. Both quantifier-freeness and evaluation under the indicator of a list of variables are polynomial-time on the existing encQBF encoding. This common API serves TAUTOLOGY and bounded quantified SAT.

Main results #

Boolean formulas are as in Arora–Barak, Section 2.3. The scan is adapted from Samuel Schlesinger's free-variable scan, with truth values in place of variable lists.

A formula is quantifier-free, a Boolean formula, when it has no quantifier.

Instances For
    @[simp]
    theorem Cslib.Logic.PL.QBF.not_quantifierFree_ex {V : Type u_1} (v : V) (φ : QBF V) :
    @[simp]
    theorem Cslib.Logic.PL.QBF.not_quantifierFree_all {V : Type u_1} (v : V) (φ : QBF V) :
    @[simp]

    Embedding a conjunctive normal form produces a quantifier-free Boolean formula.

    A formula is quantifier-free exactly when none of its tokens is a quantifier.

    A free variable of a formula occurs as a variable token.

    One step of the evaluating scan of the tokens from right to left, for a token of kind k and variable v, on the stack of the values of the subformulas read so far. Quantifiers leave the stack unchanged; the scan is meant for quantifier-free formulas.

    def Cslib.Logic.PL.QBF.evalStep (σ : ℕ → Bool) (stack : List Bool) (t : Kind × ℕ) :

    One step of the evaluating scan of the tokens from right to left.

    theorem Cslib.Logic.PL.QBF.foldl_evalStep {φ : QBF ℕ} (hφ : φ.QuantifierFree) (σ : ℕ → Bool) (stack : List Bool) :
    List.foldl (evalStep σ) stack φ.tokens.reverse = eval σ φ :: stack

    The scan of the tokens of a quantifier-free formula pushes its value.

    Evaluating a formula from its tokens is polynomial-time, under the assignment making exactly the listed variables true. On a quantifier-free formula the scan returns its value (Cslib.Logic.PL.QBF.foldl_evalStep).