Use a unified representation for all trace types

This commit is contained in:
2026-10-04 09:58:39 -05:00
parent 7c05adadff
commit d2b6bf5af7
4 changed files with 211 additions and 196 deletions

View File

@@ -99,15 +99,18 @@ lemma walkPrefix : ∀ {s₂ s : prog.State} {ρ₂ ρin : Env}
⟦ joinForKey s₂ (result L prog) ⟧ (S.Pre trₗ) →
⟦ joinForKey s (result L prog) ⟧ (S.Pre (trₗ ++ mid)) := by
intro s₂ s ρ₂ ρin mid
induction mid with
| nil => intro s₁ ρ₁ trₗ hjoin; simpa [HAppend.hAppend, Traceₗ.append] using hjoin
| cons hnode hedge rest ih =>
match mid with
| Traceₗ.nil =>
intro s₁ ρ₁ trₗ hjoin
simpa only [HAppend.hAppend, Path.append_nil] using hjoin
| Traceₗ.cons hnode hedge rest =>
intro s₁ ρ₁ trₗ hjoin
have hstep := stepTrace trₗ hjoin hnode
have hmem := FiniteMap.mem_valuesAt prog.states_nodup
(prog.mem_incoming_of_edge hedge) (variablesAt_mem _ (result L prog))
simpa [HAppend.hAppend, Traceₗ.append] using
ih ((trₗ ++ hnode).addEdge hedge)
simpa only [HAppend.hAppend, Traceₗ.appendStep, Trace.addEdge,
Path.append_assoc, Path.single, Path.append] using
walkPrefix rest ((trₗ ++ hnode).addEdge hedge)
(interp_foldr (S.post_pre (trₗ ++ hnode) hedge hstep) hmem)
omit [DecidableEq L] in