Lists, equality and tries as programs #
A library of programs, with their weighted values (Interpreter.Does, Interpreter.Gives):
- lists of trees (
Interpreter.listT): fold, reverse, concatenation, map, and a guessed element; - equality of trees (
Interpreter.eqF); - tries, read and written along paths (
Interpreter.tget,Interpreter.tset,Interpreter.getF,Interpreter.setF); Interpreter.WE: terms for elements ofAbuilt from0,1, named constants,+and*, and the formulas that multiply the weight by their value.
From VP ≠ VNP over every field [Ant26], module NS1.Lists.
Main definitions #
Interpreter.listT,Interpreter.foldF,Interpreter.appF,Interpreter.mapF,Interpreter.eqF,Interpreter.pickF.Interpreter.tget,Interpreter.tset,Interpreter.getF,Interpreter.setF.Interpreter.WE,Interpreter.WE.val,Interpreter.WE.fm.Interpreter.allBits: all bit lists of a given length.
Main results #
Interpreter.Does.runW: running a program on every value of a weighted list.Interpreter.foldF_does,Interpreter.mapF_gives,Interpreter.eqF_gives,Interpreter.pickF_does,Interpreter.getF_gives,Interpreter.setF_gives.Interpreter.WE.exists_of_adjoin: if-1is a named constant, every element of the subring generated by the constants is the value of a term.
A list of trees as a tree.
Apply the program that is the value of a formula to the values of another one.
Fold over a list with a state. The argument is (this program, (state, list)); step is applied
to
(element, state).
Fold: s gives the state at the beginning, l the list.
A deterministic fold.
Apply step to (parameter, element) for all elements of a list. The argument is (this program,
(parameter,
list)).
Map: e gives the parameter, l the list.
Equality of trees: 1 if equal, else empty. The argument is (this program, (a, b)).
Equality of two values.
Choose an element of a list. The argument is (this program, list).
Choose an element of a list.
Read a value. The argument is (this program, (path, trie)).
Read a value: p gives the path, t the trie.
Write a value. The argument is (this program, (path, (value, trie))).
Write a value: p gives the path, v the value, t the trie.
The formula of the machine.