Documentation

Complexitylib.Classes.PCP.Internal.CNFTokens

The scan agrees with the encoding #

The clause counter reads two bits at a time and counts the token 10. This module checks that against the encoding it is meant to read: every token occupies two bits, only the clause separator is 10, and a formula's encoding carries one separator per clause.

Because tokens are two bits wide and the scan steps two bits at a time, a 10 pattern straddling two tokens is never seen.

Main results #

A formula's encoding has one separator per clause.

The extraction returns one clause #

theorem Complexity.hne_litSep (t : SAT.EncToken) :
t SAT.EncToken.litSep∃ (c0 : Bool) (c1 : Bool), t.encode = [c0, c1] ¬(c0 = false c1 = true)
theorem Complexity.segFrom_encodeTokens_noSep {sep : SAT.EncToken} {b0 b1 : Bool} (hne : ∀ (t : SAT.EncToken), t sep∃ (c0 : Bool) (c1 : Bool), t.encode = [c0, c1] ¬(c0 = b0 c1 = b1)) (toks : List SAT.EncToken) :
(∀ ttoks, t sep)∀ (v : List Bool) (t c : ), segFrom b0 b1 t c (SAT.encodeTokens toks ++ v) = (if c = t then SAT.encodeTokens toks else []) ++ segFrom b0 b1 t c v

Reading past a run of non-separator tokens collects them, or not, according to whether the count matches.

theorem Complexity.segFrom_of_gt (s0 s1 : Bool) (n : ) (s : List Bool) (t c : ) :
s.length nt < csegFrom s0 s1 t c s = []

Token segments joined by a separator.

Equations
Instances For
    theorem Complexity.segFrom_tokenJoin {sep : SAT.EncToken} {b0 b1 : Bool} (hsep : sep.encode = [b0, b1]) (hne : ∀ (t : SAT.EncToken), t sep∃ (c0 : Bool) (c1 : Bool), t.encode = [c0, c1] ¬(c0 = b0 c1 = b1)) (segs : List (List SAT.EncToken)) :
    (∀ gsegs, tg, t sep)∀ (t c : ), c t∀ (hlt : t - c < segs.length), segFrom b0 b1 t c (SAT.encodeTokens (tokenJoin sep segs)) = SAT.encodeTokens segs[t - c]

    The extraction returns one segment.

    Down to a literal of a real formula #

    The extraction returns one clause of a real formula.

    The extraction returns one literal of a real clause.

    The packaged extraction returns one literal.

    theorem Complexity.length_litSegFn_encode (φ : SAT.CNF) {j p : } (hj : j < List.length φ) (hp : p < List.length φ[j]) :

    The extracted literal has the length its variable index dictates.

    The extraction reads off the variable index.