Add more machinery to use embeddings as "proofs of child-ship"
This commit is contained in:
@@ -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 (· ≤ ·)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user