Equations
- One or more equations did not get rendered due to their size.
Evaluate a procedure call lhs := pname(args).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Core.Statement.Command.eval E old_var_subst (Core.CmdExt.call lhs pname args md) = Core.Statement.Command.evalCall E old_var_subst lhs pname args md
Instances For
Generic function to check if a statement contains a specific command type.
Equations
- One or more equations did not get rendered due to their size.
- Core.Statement.Statement.containsCmd predicate (Imperative.Stmt.cmd (Core.CmdExt.cmd c)) = predicate c
- Core.Statement.Statement.containsCmd predicate (Imperative.Stmt.cmd cmd) = false
- Core.Statement.Statement.containsCmd predicate (Imperative.Stmt.block label inner_ss md) = Core.Statement.Statements.containsCmds predicate inner_ss
- Core.Statement.Statement.containsCmd predicate (Imperative.Stmt.loop guard measure invariant body_ss md) = Core.Statement.Statements.containsCmds predicate body_ss
- Core.Statement.Statement.containsCmd predicate (Imperative.Stmt.funcDecl decl md) = false
- Core.Statement.Statement.containsCmd predicate (Imperative.Stmt.goto label md) = false
Instances For
Generic function to check if statements contain a specific command type.
Equations
- Core.Statement.Statements.containsCmds predicate [] = false
- Core.Statement.Statements.containsCmds predicate (s :: ss_2) = (Core.Statement.Statement.containsCmd predicate s || Core.Statement.Statements.containsCmds predicate ss_2)
Instances For
Detect if statements contain any cover commands.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Detect if statements contain any assert commands.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Collect all cover commands from a statement s with their labels and metadata.
Equations
- Core.Statement.Statement.collectCovers (Imperative.Stmt.cmd (Core.CmdExt.cmd (Imperative.Cmd.cover label _expr md))) = [(label, md)]
- Core.Statement.Statement.collectCovers (Imperative.Stmt.cmd cmd) = []
- Core.Statement.Statement.collectCovers (Imperative.Stmt.block label inner_ss md) = Core.Statement.Statements.collectCovers inner_ss
- Core.Statement.Statement.collectCovers (Imperative.Stmt.ite cond then_ss else_ss md) = Core.Statement.Statements.collectCovers then_ss ++ Core.Statement.Statements.collectCovers else_ss
- Core.Statement.Statement.collectCovers (Imperative.Stmt.loop guard measure invariant body_ss md) = Core.Statement.Statements.collectCovers body_ss
- Core.Statement.Statement.collectCovers (Imperative.Stmt.funcDecl decl md) = []
- Core.Statement.Statement.collectCovers (Imperative.Stmt.goto label md) = []
Instances For
Collect all cover commands from statements ss with their labels and metadata.
Equations
Instances For
Collect all assert commands from a statement s with their labels and metadata.
Equations
- Core.Statement.Statement.collectAsserts (Imperative.Stmt.cmd (Core.CmdExt.cmd (Imperative.Cmd.assert label _expr md))) = [(label, md)]
- Core.Statement.Statement.collectAsserts (Imperative.Stmt.cmd cmd) = []
- Core.Statement.Statement.collectAsserts (Imperative.Stmt.block label inner_ss md) = Core.Statement.Statements.collectAsserts inner_ss
- Core.Statement.Statement.collectAsserts (Imperative.Stmt.ite cond then_ss else_ss md) = Core.Statement.Statements.collectAsserts then_ss ++ Core.Statement.Statements.collectAsserts else_ss
- Core.Statement.Statement.collectAsserts (Imperative.Stmt.loop guard measure invariant body_ss md) = Core.Statement.Statements.collectAsserts body_ss
- Core.Statement.Statement.collectAsserts (Imperative.Stmt.funcDecl decl md) = []
- Core.Statement.Statement.collectAsserts (Imperative.Stmt.goto label md) = []
Instances For
Collect all assert commands from statements ss with their labels and metadata.
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Substitute free variables in an expression with their current values from the environment,
excluding the given parameter names (which are bound by the function, not free).
This implements value capture semantics for local function declarations (funcDecl).
Unlike global functions (which are evaluated at the top level with no local state), local functions capture the values of free variables at the point of declaration. Parameters are excluded because they are bound by the function definition and should not be substituted with values from the enclosing scope.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
- stk.push ss = ss.eraseTypes :: stk
Instances For
Equations
- Core.Statement.StmtsStack.pop [] = []
- Core.Statement.StmtsStack.pop (head :: rst) = rst
Instances For
Equations
- Core.Statement.StmtsStack.top [] = []
- Core.Statement.StmtsStack.top (head :: rst) = head
Instances For
Equations
- stk.appendToTop ss = (stk.top ++ ss.eraseTypes) :: stk.pop
Instances For
A new environment with an optional next label to execute and transformed statements (i.e., statements that have already been evaluated).
- env : Env
- stk : StmtsStack
Instances For
Drop statements up to the given label, and indicate whether goto needs to propagate up.
NOTE: We only allow forward-gotos right now.
Equations
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Core.Statement.evalAux E old_var_subst ss optLabel = Core.Statement.evalAuxGo (Imperative.Block.sizeOf ss) old_var_subst { env := E } ss optLabel
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Core.Statement.gotoToError { env := env, stk := stk } = (List.flatten stk, env)
Instances For
Partial evaluator for statements yielding a list of environments and transformed statements.
The argument old_var_subst below is a substitution map from global variables
to their pre-state value in the enclosing procedure of ss.
Equations
- Core.Statement.eval E old_var_subst ss = List.map Core.Statement.gotoToError (Core.Statement.evalAux E old_var_subst ss none)
Instances For
Partial evaluator for statements yielding one environment and transformed statements.
Equations
- One or more equations did not get rendered due to their size.