Routines reading an encoded formula #
Counter-program routines that navigate the flat layout of an encoded formula
(Cslib.Complexity.TwoSAT.literalBits, Cslib.Complexity.TwoSAT.clauseBits) with positions held
in registers, each placed at a label and continuing at given labels:
Cslib.Complexity.TwoSAT.skipLitCodemoves a position past a literal, group by group;Cslib.Complexity.TwoSAT.skipClauseCodemoves a position past a clause, literal by literal;Cslib.Complexity.TwoSAT.cmpVarCodecompares the variables of two literals digit by digit;Cslib.Complexity.TwoSAT.signCodereads the polarity of a literal.
None of them reads register 0, so they can be part of nondeterministic counter programs. Their
specifications are deterministic runs (Turing.CounterProgram.Reaches) through configurations
with bounded registers at instructions that do not read the choice
(Turing.CounterProgram.Oblivious).
Main definitions #
Cslib.Complexity.TwoSAT.skipLitCode,Cslib.Complexity.TwoSAT.skipClauseCode,Cslib.Complexity.TwoSAT.cmpVarCode,Cslib.Complexity.TwoSAT.signCode.
Main results #
Skipping a literal #
The code moving the position in register p past the literal there: groups with a marker
as fourth bit are digits, eight bits long, and the end group is ten bits long.
Instances For
Skipping a literal.
Skipping a clause #
The code moving the position in register p past the clause there, literal by literal.
Instances For
Skipping a clause.
Comparing variables #
The code comparing the variables of the literals at the positions in registers p₁ and p₂,
digit by digit, with cursors in registers t₁ and t₂: it continues at eq when they are the
same variable and at ne otherwise.
Instances For
Comparing variables: the run ends at eq exactly when the variables are equal, with the
cursors within the literals.
Reading the polarity #
The code reading the polarity of the literal at the position in register p, with a cursor
in register t: it continues at yes for a positive literal and at no otherwise.
Instances For
Reading the polarity.