Documentation

CslibFrontier.Computability.Machines.Turing.MultiTape.Internal.InductiveValidation

Preflight validation for recursive inductive encodings #

checkRecursiveInductive checks an applied inductive type and explicit field encoding choices without emitting declarations. Uniform parameters may be types or values. Recursive positions are marked by _; all other positions require an embedding into Boolean words. Genuine indices, mutual or nested recursion, implicit fields, proof fields, and fields depending on earlier fields are rejected. Constructor fields may depend on the uniform parameters.

The checked input to recursive encoding generation. Every constructor has parallel arrays of field types and recursion flags, in declaration order.

  • typeName : Lean.Name

    The inductive declaration, before application to its uniform parameters.

  • fieldTypes : Array (Array Lean.Term)

    All constructor field types, with the chosen uniform parameters substituted.

  • recursiveFields : Array (Array Bool)

    Whether each field is precisely the applied inductive type being encoded.

Inspect a supported family before selecting field encodings or emitting declarations. T is fully applied to uniform parameters from the current section. The returned field types contain no constructor-local variables. Shared by the explicit and policy-driven frontends.

Check the explicit constructor list and embeddings before generation. Structural inspection is shared with derive_encoding; the explicit command never consults a codec registry.