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 #
Cslib.Logic.PL.QBF.quantifierFree_iff_tokens: recognize quantifier-free syntax.Cslib.Logic.PL.QBF.foldl_evalStep: correctness of the evaluating scan.Cslib.Complexity.computableInPolyTime_decide_quantifierFree.Cslib.Complexity.computableInPolyTime_evalTokens.
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
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.
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.
Deciding quantifier-freeness is polynomial-time.
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).