Linear combinatorial size of fixed-gadget replacement #
Relabeling preserves constraint counts and variable-occurrence counts. Each input constraint therefore contributes exactly the fixed size of its chosen template. The number of distinct output variables is at most the number of output occurrences. For a finite source alphabet, the guarded compiler has a uniform linear bound on output variables plus constraints, including malformed inputs and the empty instance.
These are combinatorial counts, not binary encoding lengths. Fresh variable names contain constraint indices, so the binary encoding may incur an additional logarithmic factor.
Main results #
Cslib.Logic.PL.CSP.length_replaceGadgets: exact output constraint count.Cslib.Logic.PL.CSP.vars_length_replaceGadgets: exact output occurrence count.Cslib.Logic.PL.CSP.exists_linear_bound_replaceGadgetsGuarded: the guarded linear bound.
Each source constraint contributes exactly the constraints in its fixed template.
Relabeling template ports preserves their occurrence count, even when ports coincide.
A bound on template occurrences plus constraints bounds distinct output variables plus constraints. No freshness or well-formedness assumption is needed for this size inequality.
Fixed finite template lookup and a fixed malformed-input reject instance give a linear bound on distinct output variables plus constraints, for every raw input. The constant is independent of the input and of its numeric variable labels.