Pure fixed-gadget replacement #
The existing primitive-positive gadget is instantiated in the original source scope, with
free names 2*v and private auxiliary names 2*(B*i+j)+1. The exact-arity guard and semantic
correctness retain repeated variables, duplicate constraints, empty and nullary instances.
This module contains the unchanged logical replacement declarations formerly in the native runtime module. It has no native computability imports or runtime certificates. The native module publicly imports this topic, preserving the original declaration names and visibility.
Main definitions #
Cslib.Logic.PL.CSP.PPGadget.template: uniform local free and auxiliary ports.Cslib.Logic.PL.CSP.instantiate: instantiate one fixed template at a source scope.Cslib.Logic.PL.CSP.replaceGadgets: exact flat-mapped replacement body.Cslib.Logic.PL.CSP.replaceGadgetsGuarded: exact-arity guarded replacement.
Main results #
Cslib.Logic.PL.CSP.satisfiable_replaceGadgets_iff: semantics on well-formed source bodies.Cslib.Logic.PL.CSP.wellFormed_satisfiable_replaceGadgetsGuarded_iff: all-raw guarded semantics.
The construction is the equality-free case of [Che06], Proposition 3.9, arXiv v1, p. 8.
Renaming a well-formed gadget preserves exact target arities.
Replacing with well-formed templates produces well-formed target constraints.
The guarded compiler produces a well-formed result if its fixed reject instance is well formed.
Instantiating an actual gadget evaluates its original body at the supplied even free names and odd per-occurrence auxiliary names, for every fixed target assignment. No satisfiability or arity premise is needed for this pointwise equation.
Correct gadgets preserve satisfiability on well-formed inputs. Only a uniform bound on the number of auxiliary ports is required.
The exact-arity guard gives total correctness, including malformed inputs. The supplied reject instance must be unsatisfiable.
Full guarded correctness for the exact-arity CSP decision predicate. A reject target may fail either well-formedness or satisfiability, allowing a fixed malformed constraint.
The fixed reject target fails exact arity independently of its semantics.