Closedness of a quantified Boolean formula in polynomial time #
The free variables of a formula are computed by one scan of its tokens from right to left, with a
stack holding the free variables of the subformulas read so far
(Cslib.Logic.PL.QBF.freeVarStep): a variable pushes itself, a constant pushes nothing, a binary
connective joins the two lists on top of the stack, and a quantifier removes its variable from the
list on top. On the tokens of a formula the scan ends with the list of its free variables
(Cslib.Logic.PL.QBF.foldl_freeVarStep_tokens), so a formula is closed exactly when that list is
empty (Cslib.Logic.PL.QBF.isClosed_tokens), and closedness is decided in polynomial time
(Cslib.Complexity.TQBF.computableInPolyTime_decide_closed).
Main definitions #
Cslib.Logic.PL.QBF.freeVarList: the free variables of a formula, with multiplicity.Cslib.Logic.PL.QBF.freeVarStep,Cslib.Logic.PL.QBF.isClosed: the scan of the tokens.
Main results #
Cslib.Logic.PL.QBF.mem_freeVarList: the list has the free variables as elements.Cslib.Logic.PL.QBF.isClosed_tokens: the scan decides closedness.Cslib.Complexity.TQBF.computableInPolyTime_decide_closed: in polynomial time.
Free variables by a scan of the tokens #
The elements of freeVarList φ are the free variables of φ.
A formula is closed exactly when its list of free variables is empty.
Closedness is decided in polynomial time.