Documentation

CslibFrontier.Logics.Propositional.PlaistedGreenbaumCNF.Numbered

The Plaisted–Greenbaum transformation with numbered variables #

The Plaisted–Greenbaum transformation Cslib.Logic.PL.Proposition.plaistedGreenbaumCNF names a subformula by the subformula itself, so comparing two of its variables costs as much as comparing two subformulas. Here the variables are numbers. A proposition over the atoms Fin n is traversed once, in post-order: the atom i is the variable i, and every other node gets the next unused number, counting from n. Each node prepends to an accumulator the definitional clauses its polarity needs, so no list is copied (Proposition.plaistedGreenbaumClauses). At positive polarity they say that the node's variable implies the node, at negative polarity the converse; the antecedent of → flips the polarity. No running-time bound is stated here.

A number names one occurrence of a subformula, so it has one polarity. Equal subformulas at different positions get different numbers, and so may get different directions of their definitions.

The numbered transformation is the Plaisted–Greenbaum transformation up to renaming and the order of the clauses: renaming every number to the variable of the subformula it was given (Proposition.plaistedGreenbaumNumberedVar) turns it into a permutation of A.plaistedGreenbaumCNF (Proposition.perm_relabel_plaistedGreenbaumNumberedCNF). This renaming is not injective, since equal subformulas share a variable of A.plaistedGreenbaumCNF. The models therefore transfer in one direction through the renaming, and in the other by a direct argument: every model of the numbered transformation satisfies A at the atoms (Proposition.eval_of_eval_plaistedGreenbaumNumberedCNF). So the two are equisatisfiable (Proposition.satisfiable_plaistedGreenbaumNumberedCNF_iff) and have the same size bound.

Main definitions #

Main results #

References #

The result of the Plaisted–Greenbaum traversal of a subformula.

  • var : ℕ

    The variable of the subformula.

  • next : ℕ

    The first number not yet used.

  • clauses : CNF ℕ

    The clauses so far, those of the subformula first.

The Plaisted–Greenbaum traversal of a proposition over Fin n at the polarity pol (true for positive). From the first unused number k and the clauses acc so far, it returns the variable of the proposition, the next unused number, and the clauses with the definitional clauses of the subformulas prepended: for a node op(B, C) with variable x, those saying that x implies op of the variables of B and C at positive polarity, and the converse at negative polarity. The antecedent of → has the opposite polarity. The numbering does not depend on the polarity.

The Plaisted–Greenbaum transformation with numbered variables Plaisted and Greenbaum: the clauses of the traversal from the number n on at positive polarity, and the unit clause asserting the variable of the proposition.

Renaming to the Plaisted–Greenbaum transformation #

The subformulas of a proposition that get numbers, in the order of their numbers: the subformulas other than atoms, in post-order.

The variable of A.plaistedGreenbaumCNF named by a number in A.plaistedGreenbaumNumberedCNF: an atom below n, and the subformula it was given from n on.

The numbered Plaisted–Greenbaum transformation is the Plaisted–Greenbaum transformation up to renaming and the order of the clauses.

Every model of the numbered Plaisted–Greenbaum transformation satisfies the proposition at the atoms.

The numbered Plaisted–Greenbaum transformation preserves satisfiability.

Size #

The numbered Plaisted–Greenbaum transformation has at most two clauses per node, and one more.