@@ -20,43 +20,43 @@ languages that support calls.
2020class CallCapable (Stmt : Type ) where
2121 -- Create a simple function call (no return value)
2222 simpleCall : String → List Heap.HExpr → Stmt
23-
23+
2424 -- Create a function call with return values
2525 call : List String → String → List Heap.HExpr → Stmt
26-
26+
2727 -- Inspection methods for analyses
2828 getCallInfo : Stmt → Option (List String × String × List Heap.HExpr) -- (lhs, funcName, args)
29-
29+
3030 -- Check if this statement is a call
3131 isCall : Stmt → Bool
32-
32+
3333 -- Extract the underlying imperative statement if possible
3434 asImperativeStmt : Stmt → Option (Imperative.Stmt (Imperative.Cmd Heap.HExpr))
3535
3636-- Default implementation for Call dialect statements
3737instance : CallCapable (CallStatement Heap.HExpr) where
38- simpleCall funcName args :=
38+ simpleCall funcName args :=
3939 CallStatement.simpleCall funcName args
40-
41- call lhs funcName args :=
40+
41+ call lhs funcName args :=
4242 CallStatement.call lhs funcName args
43-
43+
4444 getCallInfo stmt := match stmt with
4545 | .cmd (.directCall lhs funcName args) => some (lhs, funcName, args)
4646 | _ => none
47-
47+
4848 isCall stmt := match stmt with
4949 | .cmd (.directCall _ _ _) => true
5050 | _ => false
51-
51+
5252 asImperativeStmt stmt := match stmt with
5353 | .cmd (.imperativeCmd cmd) => some (.cmd cmd)
54- | .ite cond thenb elseb =>
54+ | .ite cond thenb elseb =>
5555 -- Convert blocks by filtering out calls (for now)
5656 let thenStmts := thenb.ss.filterMap (fun s => match s with
5757 | .cmd (.imperativeCmd cmd) => some (.cmd cmd)
5858 | _ => none)
59- let elseStmts := elseb.ss.filterMap (fun s => match s with
59+ let elseStmts := elseb.ss.filterMap (fun s => match s with
6060 | .cmd (.imperativeCmd cmd) => some (.cmd cmd)
6161 | _ => none)
6262 some (.ite cond ⟨thenStmts⟩ ⟨elseStmts⟩)
0 commit comments