Documentation

CslibFrontier.Computability.Circuit.Boolean.NativeEvaluation

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 #

Main results #

Retained evaluation of one De Morgan gate. Missing arguments and out-of-range wires read false, exactly as in evalCodeStep interpretation false.

Peak lifted-callback workspace over the actual runtime gate-list scan.

Peak encoded trace/gate length over the actual runtime gate-list scan.

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.

@[simp]

The raw evaluator emits the initial bits followed by exactly one bit per gate.

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.

@[simp]

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.