Static expansion of primitive-positive gadgets #
A finite macro body is interpreted using actual original-language gadgets. Each constraint occurrence receives a fresh auxiliary block, even when its symbol and scope repeat. Blocks have their actual lengths; no uniform bound or finite relation alphabet is required. The macro's old auxiliaries precede the concatenation of replacement auxiliaries. Free ports retain their index order. This module proves semantics only; ordered numerical witnesses are constructed separately in the planar expansion bridge.
Main definitions #
Cslib.Logic.PL.CSP.PPGadget.expandList: expansion on finite named ports.Cslib.Logic.PL.CSP.PPGadget.expand: expansion with the macro's original existential ports.
Expand a finite conjunction on named finite ports by the existing conjunction and free-port substitution constructors. Its auxiliary layout is the ordered ragged sum of the actual replacement sizes. Nullary constraints and empty bodies are retained.
Exact auxiliary count: every source occurrence contributes its own replacement size.
Expand a checked semantic macro into the original language. The macro's existential ports are hidden using the existing substitution operation, before the fresh ragged blocks. This is finite static preprocessing and makes no native running-time assertion.
Old macro auxiliaries precede the actual per-occurrence replacement blocks.