Term graphs: relationalizing a term's value (Craig Layer 3, Unit 3) #
The graph formula of a term: termGraph t y asserts, in the relationalized language
graphLanguage L, that the value of the L-term t is (the value of) the variable term y.
Nested applications are flattened through auxiliary bound variables — one block of k fresh
variables per k-ary function application, bound by existsBlock — with each argument's value
pinned by its own recursive graph formula and the application itself by one graph atom
G_f(y⃗, y).
Design #
The recursion is context-polymorphic (termGraphAux): instead of relabeling already-built
graph formulas when the bound context grows, the auxiliary carries a variable embedding
ρ : β → (graphLanguage L).Term (α ⊕ Fin m) of the term's variables into the current context
and a proposed output term y. Recursive calls enlarge m by the function arity while still
structurally recurring on a genuine subterm, and existsBlock (Unit 2) handles all environment
growth uniformly. Arity 0 (constants) is the same construction with an empty witness block —
no special case.
The semantics is oriented term value equals output — matching the landed graph-relation
definition funMap f args = output (graphExpansion_relMap_graph) — so no symmetry rewrites
are ever needed.
Main Results #
realize_termGraphAux: the stronger context-polymorphic semantics,(termGraphAux t ρ y).Realize v xs ↔ t.realize (fun z => (ρ z).realize (Sum.elim v xs)) = y.realize (Sum.elim v xs)over the graph expansion.realize_termGraph: the public form,t.realize (Sum.elim v xs) = y.realize (Sum.elim v xs).relationsIn_termGraph: the graph formula's relation occurrences are exactly thegraphRelSym-image oft.functionsIn— in particular no base relations occur (relationsIn_termGraph_inter_base), and no function symbols occur at all (functionsIn_termGraph, the language is relational).- The nested-term pilot
f(g(x), h(c))(genuinely nested, includes a0-ary application).
Context lifting and witness variables #
Lift a graph-language term along the bound-context extension m → m + k (the existing
context keeps the first m coordinates).
Equations
Instances For
The term-graph formula #
The context-polymorphic term-graph formula: termGraphAux t ρ y asserts that the value of
the L-term t — its variables read through the embedding ρ into the current context — is
the value of y. A variable is an equality atom; an application f(t₀, …, t_{k-1}) extends the
context by k witness variables, pins each argument's value with a recursive graph formula,
adds the graph atom G_f(y⃗, y), and existentially closes the witness block.
Equations
- One or more equations did not get rendered due to their size.
- FirstOrder.Language.termGraphAux (FirstOrder.Language.var z) x✝¹ x✝ = FirstOrder.Language.BoundedFormulaω.equal (x✝¹ z) x✝
Instances For
The term-graph formula over the ambient context, via the identity variable embedding:
termGraph t y asserts in graphLanguage L that the value of t is the value of y.
Equations
Instances For
Semantics over the graph expansion #
Auxiliary semantics (the stronger, context-polymorphic form): over the graph expansion,
termGraphAux t ρ y holds iff the value of t — its variables read through ρ — equals the
value of y. Oriented term value equals output, matching graphExpansion_relMap_graph.
Public semantics: over the graph expansion, termGraph t y holds iff the value of t
equals the value of y in the ambient environment.
The nested-term pilot: f(g(x), h(c)) #
Genuinely nested arguments (each argument is itself an application) and a 0-ary application
(c), all through the same construction — the acceptance gate for the unit.
Occurrence identities #
The relation symbols of the auxiliary term-graph formula are exactly the graph relations of
the term's function symbols — independent of the embedding ρ and the output y (graph-language
terms are pure variables and contribute nothing).