Retained native evaluation of Boolean circuits #
This module keeps the concrete multitape programs used to evaluate De Morgan gate lists and fixed
typed circuits. The raw evaluator scans the encoded gate list once and retains exact native time,
workspace, input, output, and static-description coordinates. The fixed evaluator hardwires one
installedCode := const (encBitString n) encCode c.code subcompiler, so callers add no separate
external c.code charge. NativeCompiler.staticBits charges the complete generated
transition-table description, including all composed evaluator and controller code.
Main definitions #
Cslib.Circuits.Boolean.evalCodeStepCompiler: retained evaluation of one encoded gate.Cslib.Circuits.Boolean.evalCodeCompiler: retained evaluation of a runtime-supplied gate list.Cslib.Circuits.Boolean.evalCircuitCompiler: retained evaluation of one fixed typed circuit.
Main results #
Cslib.Circuits.Boolean.computableInPolyTime_evalFixedCircuit: the fixed evaluator's ordinary polynomial-time abstraction.
Retained evaluation of one De Morgan gate. Missing arguments and out-of-range wires read
false, exactly as in evalCodeStep interpretation false.
Retained evaluation of a runtime-supplied De Morgan gate list. The gate list is input data, not installed code; every framed gate is scanned by the concrete stream machine.
Retained evaluation of one fixed typed De Morgan circuit. The construction contains exactly
one installedCode := const (encBitString n) encCode c.code subcompiler, so callers add no second
external encCode c.code charge. Runtime charges include emitting and marshalling that code on
each invocation. staticBits charges the complete generated transition-table description,
including the inlined lookup, evaluator and controller code; it is not a count of literal encoded
code occurrences in that table.
A fixed n-by-m circuit evaluator emits exactly m raw output bits.
Forget the fixed evaluator's concrete program and resource coordinates to the ordinary polynomial-time interface. The proof packages the retained machine itself, bounded by the maxima of its exact time and workspace maps over the fixed-width input type.