Equations
- One or more equations did not get rendered due to their size.
Evaluate a procedure call by inlining its contract.
args and lhs are matched positionally against
proc.header.inputs and proc.header.outputs respectively.
Equations
- One or more equations did not get rendered due to their size.
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 invariants 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.exit label md) = false
- Core.Statement.Statement.containsCmd predicate (Imperative.Stmt.typeDecl tc 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 invariants body_ss md) = Core.Statement.Statements.collectCovers body_ss
- Core.Statement.Statement.collectCovers (Imperative.Stmt.funcDecl decl md) = []
- Core.Statement.Statement.collectCovers (Imperative.Stmt.exit label md) = []
- Core.Statement.Statement.collectCovers (Imperative.Stmt.typeDecl tc 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 invariants body_ss md) = Core.Statement.Statements.collectAsserts body_ss
- Core.Statement.Statement.collectAsserts (Imperative.Stmt.funcDecl decl md) = []
- Core.Statement.Statement.collectAsserts (Imperative.Stmt.exit label md) = []
- Core.Statement.Statement.collectAsserts (Imperative.Stmt.typeDecl tc md) = []
Instances For
Collect all assert commands from statements ss with their labels and metadata.
Equations
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
An environment with an optional exit label.
- env : Env
none= no exit active;some none= exit nearest block;some (some l)= exit blocklStack of unmerged split conditions. Each entry is
(splitId, cond, side)wheresplitIduniquely identifies the split origin (both paths from the same split get the samesplitId),condis the branch condition expression, andsidedistinguishes the branches (true= then,false= else for ITE splits). Last element is the most recent (innermost) unmerged split.Key invariant: both sides of a split always share the same
splitIdandcond; onlysidediffers. Entries are only pushed inprocessIteBrancheswhenpathCapis active.mergeCondPairsrelies on this to correctly pair and merge paths.
Instances For
Batch symbolic evaluator: evaluates a statement list for all input paths simultaneously. Between each statement, enforces the path cap by merging continuing (.none exit) paths.
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
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.exitToError { env := env, splitConds := splitConds } = env
Instances For
A symbolic simulator for statements yielding a list of resulting environments.
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 = match Core.Statement.evalAux E old_var_subst ss none with | (ewns, stats) => (List.map Core.Statement.exitToError ewns, stats)
Instances For
A symbolic simulator for statements yielding one environment.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Interpret a single procedure call.
Importantly, this creates a separate Env to execute the body of the procedure with, which initially only contains input/output variables. The resulting Env is the original passed in Env with the output variables copied back into it.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Core.Statement.Command.run fuel E (Core.CmdExt.cmd c_2) = Imperative.Cmd.run E c_2
- Core.Statement.Command.run fuel E (Core.CmdExt.call pname callArgs md) = Core.Statement.Command.runCall (Core.CallArg.getLhs callArgs) pname (Core.CallArg.getInArgs callArgs) fuel E