Programs whose values are encodings of typed values #
The values of a formula of the tree machine are trees. A program that computes with states of a
type β holds a state b as its encoding enc b : Tree, and its weighted list of values is
l.map (Prod.map id enc) for a weighted list l : List (A × β) of typed values. This file has
the rules of Interpreter.Does for such lists: the second part of a sequence is given at every
typed value b, and the list of the sequence is l.weightedBind f (List.weightedBind). The
encoding need not be injective.
The operations Interpreter.wsum, Interpreter.bindW, Interpreter.foldW of the interpreter are
the operations List.weightedSum, List.weightedBind, List.weightedFoldl of weighted lists at
the type of trees.
Main results #
Interpreter.wsum_eq_weightedSum,Interpreter.bindW_eq_weightedBind,Interpreter.foldW_eq_weightedFoldl.Interpreter.Does.wsum_unique: the weighted sums are determined by the program.Interpreter.Does.of_eq: replace the list by an equal one.Interpreter.Does.app_enc,Does.lett_enc,Does.lett_enc_enc,Does.letk_enc,Does.run_enc: sequences with typed values in the middle.Interpreter.Does.ite_nil: a condition with the empty value and a weight.Interpreter.foldF_does_enc,Interpreter.foldF_gives_enc: folds with a typed state over a list of typed elements.
References #
From VP ≠ VNP over every field [Ant26], Appendix J.3 (the evaluator in the proof of
Theorem J.3); module Nc.Grp.Lang.
Apply a fixed program to typed values.
Apply a program that is the value of a formula to typed values.
let with typed values.
let with typed values and typed results.
let, with the argument kept, typed values.
The first of two formulas has the empty value, with a weight: go on with the last one.
A fold with a typed state over a list of typed elements.
A deterministic fold with a typed state over a list of typed elements.