Documentation

Complexity.Computability.Complexity.Classes.LogSpace.FirstOrder.Transducer

The domain-counting interpretation transducer #

A first-order interpretation whose formulas are written in a language Ls is computed, on encoded finite relational structures, by one logarithmic-space transducer. The language Ls is the input vocabulary itself for order-free interpretations, or its canonical numeric expansion for ordered ones; a FormulaCompiler supplies the atomic handlers for Ls, the least admissible input cardinality, and the semantics of Ls on admissible inputs.

The transducer checks the input shape and cardinality, counts the tuples satisfying the domain formula to emit the unary output cardinality, and emits each relation table by repeatedly reconstructing the tuples of the requested ranks. Tuples are numbered through a fixed enumeration e : ι ≃ Fin d of the coordinates (tupleEquiv e); lexicographic order is the instance e = Fin.revPerm. Each loop counter is polynomially bounded in the input length; the counter-program simulation therefore supplies a total ComputableInLogSpace machine. Neither the output structure nor its tables are stored.

Inputs with invalid table shapes or a cardinality below the compiler's bound map to a fixed malformed target instance. Raw bit strings outside the image of encStructure are outside the encoded-input contract. Empty domains, nullary relations and zero-dimensional interpretations are included.

Main definitions #

Main results #

References #

structure Cslib.Logic.Vocabulary.ModelChecker.FormulaCompiler {L : FirstOrder.Language} [L.IsRelational] (v : Vocabulary L) (Ls : FirstOrder.Language) :
Type (max (max (max (max 1 u) u') v) v')

A formula compiler for the domain-counting transducer, over input vocabulary v and formula language Ls: the least admissible cardinality minCard, the structure on Ls built from the decoded input on admissible cardinalities, and atomic handlers that realize it on every well-formed admissible input.

Instances For

    Encode the structure interpreted by I in an admissible input, with the formula semantics of C, numbering its elements by the ranks of their tuple indices under e. Malformed inputs and cardinalities below C.minCard map to a fixed malformed structure encoding.

    Instances For

      The output cardinality is the number of domain tuples.

      @[simp]

      Shape validity of the output is exactly admissibility of the input.

      Registers and code #

      Frames of counted bits #

      The complete transducer #

      The domain-counting transducer: computing a first-order interpretation, with the formula semantics of a compiler C, on encoded finite relational structures uses logarithmic work space. The output is streamed, including its unary cardinality frame; inadmissible inputs map to a fixed malformed output.