Skip to content
Browse chapters
Imports

VERTEX-COVER complement machine: transformed header controller

The controller preserves the unary vertex count and subtracts the unary target count from a second copy. Its prepend-only output is deliberately emitted from right to left, producing the canonical header n, n - k.

noncomputable sectionnamespace CLRS.Chapter34.Turing.VertexCover.ComplementMachine.Headeropen PolyBuilder

Header of the complement instance, without its edge table.

inductive Label | start | vertices | incrementRemaining | incrementOriginal | targets | decrementRemaining | clearEdges | emitRightSeparator | emitRemaining | pushRemainingTick | emitMiddleSeparator | emitOriginal | pushOriginalTick | emitInstance | invalid | halt deriving DecidableEq, Fintype

Fixed controller computing the complement header from a canonical CLIQUE instance encoding.

def cfg (label : Label) (buffer : Option CliqueSym) (test : Bool) (input output : List CliqueSym) (remaining original : List Unit) : BuilderCfg program where label := some label buffer₁ := buffer buffer₂ := none test := test input := input output := output work₁ := [] work₂ := [] counter₁ := remaining counter₂ := original counter₃ := []end CLRS.Chapter34.Turing.VertexCover.ComplementMachine.Header