Clean up namespaces in the analysis framework
- Wrap the forward-analysis framework in a Spa.Forward namespace so its generic names (analyze, result, joinAll, variablesAt, ...) no longer sit flat in Spa, matching the ConstAnalysis/SignAnalysis convention. - Merge the split Graph namespace in Graphs.lean by relocating buildCfg. - Use nested namespace Spa / Fixedpoint instead of Spa.Fixedpoint. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -89,17 +89,6 @@ def singleton (bss : List BasicStmt) : Graph where
|
||||
def wrap (g : Graph) : Graph :=
|
||||
singleton [] ⤳ g ⤳ singleton []
|
||||
|
||||
end Graph
|
||||
|
||||
open Graph in
|
||||
def buildCfg : Stmt → Graph
|
||||
| .basic bs => Graph.singleton [bs]
|
||||
| .andThen s₁ s₂ => buildCfg s₁ ⤳ buildCfg s₂
|
||||
| .ifElse _ s₁ s₂ => buildCfg s₁ ∙ buildCfg s₂
|
||||
| .whileLoop _ s => Graph.loop (buildCfg s)
|
||||
|
||||
namespace Graph
|
||||
|
||||
variable (g : Graph)
|
||||
|
||||
def indices : List g.Index := List.finRange g.size
|
||||
@@ -123,4 +112,11 @@ theorem edge_of_mem_predecessors {idx₁ idx₂ : g.Index}
|
||||
|
||||
end Graph
|
||||
|
||||
open Graph in
|
||||
def buildCfg : Stmt → Graph
|
||||
| .basic bs => Graph.singleton [bs]
|
||||
| .andThen s₁ s₂ => buildCfg s₁ ⤳ buildCfg s₂
|
||||
| .ifElse _ s₁ s₂ => buildCfg s₁ ∙ buildCfg s₂
|
||||
| .whileLoop _ s => Graph.loop (buildCfg s)
|
||||
|
||||
end Spa
|
||||
|
||||
Reference in New Issue
Block a user