Add more machinery to use embeddings as "proofs of child-ship"

This commit is contained in:
2026-08-09 17:30:38 -05:00
parent 827d55c6b6
commit 1eecf45c0f
2 changed files with 18 additions and 0 deletions

View File

@@ -31,6 +31,12 @@ def cfg : Graph := Graph.wrap p.rootStmt.cfg
/-- A state in the control flow `Spa.Graph` of this program. -/
abbrev State : Type := p.cfg.Index
/-- The root statement's CFG sits inside the program's CFG (that graph `wrap`ped
in an entry and an exit node). -/
def rootEmbed : GGraph.Embed p.rootStmt.cfg p.cfg :=
(GGraph.Embed.sequenceLeft p.rootStmt.cfg (Graph.singleton none)).trans
(GGraph.Embed.sequenceRight (Graph.singleton none) _)
/-- Variables mentioned or defined in this program. -/
def vars : List String := p.rootStmt.vars.sort (· ·)