Documentation

DescriptiveComplexity.Problems.Hamilton.CountingGadget

The row graph of a CNF formula #

The graph whose Hamilton circuits are the exactly-one models of a CNF formula, as a graph on a type of its own (DescriptiveComplexity.HamGadget.Vtx): the interpretation that draws it in the formula is in DescriptiveComplexity.Problems.Hamilton.CountingHardness, and everything about circuits is proved here, where a vertex is a constructor and not a tagged tuple.

The graph #

Each variable x of the formula has a row, a two-way path

lft x, pad0 x, [ain o₁, bout o₁], pad o₁, [ain o₂, bout o₂], pad o₂, …, pad oₖ, rgt x

through its occurrences o₁ < … < oₖ (DescriptiveComplexity.SatOcc.VarStep), and an entry vertex top x with arcs to both ends; both ends have an arc to the top of the next variable, cyclically. A row is traversed from lft to rgt when the variable is true, from rgt to lft when it is false.

Inside the pair of an occurrence the path is not two-way. For a positive occurrence in the clause c the arcs are ain → cls c → bout and bout → ain: there is no arc ain → bout, so a row traversed from the left – the direction making the literal true – has to visit the clause vertex. A negative occurrence is the mirror image. A clause vertex is therefore visited once per true literal, and a Hamilton circuit visits it once: exactly one literal of each clause is true.

The pad vertices have their two row neighbours and nothing else, which is what forces a row to be traversed in one sweep: a circuit cannot enter a clause vertex from one row and leave into another without stranding a pad.

A formula with no clause has no row; its one model is matched by the single vertex zero, with a loop.

This file #

The vertices, the arcs (DescriptiveComplexity.HamGadget.Arc), the circuit of an assignment (DescriptiveComplexity.HamGadget.S), and the order lemmas both directions of the correspondence use: the cyclic successor on the variables of the formula, induction along the occurrences of a variable in both directions, and the rank of an occurrence.

The vertices of the row graph.

  • top {A : Type} (x : A) : Vtx A

    The entry of the row of the variable x.

  • lft {A : Type} (x : A) : Vtx A

    The left end of the row of x.

  • rgt {A : Type} (x : A) : Vtx A

    The right end of the row of x.

  • pad0 {A : Type} (x : A) : Vtx A

    The padding between the left end and the first occurrence of x.

  • ain {A : Type} (s : Bool) (x c : A) : Vtx A

    The left vertex of the occurrence of sign s of x in c.

  • bout {A : Type} (s : Bool) (x c : A) : Vtx A

    The right vertex of the occurrence of sign s of x in c.

  • pad {A : Type} (s : Bool) (x c : A) : Vtx A

    The padding after the occurrence of sign s of x in c.

  • cls {A : Type} (c : A) : Vtx A

    The vertex of the clause c.

  • zero {A : Type} : Vtx A

    The single vertex of a formula with no clause.

Instances For
    Dependency graph

    The cyclic order on the variables of the formula #

    Dependency graph
    Dependency graph

    y is the variable of the formula immediately after x.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      Dependency graph
      Dependency graph
      Dependency graph
      Dependency graph

      The occurrences of a variable: ranks and inductions #

      The rank of an occurrence of x: the number of occurrences of x before it.

      Equations
      Instances For
        Dependency graph

        The number of occurrences of x.

        Equations
        Instances For
          Dependency graph
          Dependency graph
          Dependency graph
          Dependency graph
          Dependency graph

          The graph #

          Dependency graph

          The arcs of the row graph, between vertices assumed to exist.

          Equations
          Instances For
            Dependency graph
            Dependency graph

            The circuit of an assignment, as its “comes next” relation: the row of a true variable is traversed from the left, that of a false one from the right, and a clause vertex is visited from the occurrence of a true literal.

            Equations
            Instances For
              Dependency graph