Documentation

Strata.Languages.Core.StatementEval

@[reducible, inline]

Location of expressions this file builds itself.

Equations
Instances For
    Instances For
      @[instance_reducible]
      Equations
      • One or more equations did not get rendered due to their size.

      Create fresh variables for return and LHS mapping.

      Return mapping is used for postcondition substitution, i.e., to map procedure's return parameter names to fresh variables.

      LHS mapping is used for environment updates, i.e., to map caller's LHS variable names to the same fresh variables as above.

      For example, if we have call x := Inc(8) where Inc returns a variable named ret: Return mapping: [("ret", fresh_var)] LHS mapping: [("x", fresh_var)]

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For

        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
          Equations
          Instances For
            @[irreducible]

            Generic function to check if a statement contains a specific command type.

            Equations
            Instances For
              @[irreducible]

              Generic function to check if statements contain a specific command type.

              Equations
              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

                    An environment with an optional exit label.

                    • env : Env
                    • exitLabel : Option (Option String)

                      none = no exit active; some none = exit nearest block; some (some l) = exit block l

                    • splitConds : Array (Nat × Expression.Expr × Bool)

                      Stack of unmerged split conditions. Each entry is (splitId, cond, side) where splitId uniquely identifies the split origin (both paths from the same split get the same splitId), cond is the branch condition expression, and side distinguishes 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 splitId and cond; only side differs. Entries are only pushed in processIteBranches when pathCap is active. mergeCondPairs relies on this to correctly pair and merge paths.

                    Instances For

                      What statement evaluation passes from each path to the next, in evaluation order: the next split id, and the name supply, so that no two paths generate the same name. During statement evaluation, an env holds an empty name supply except while one of its commands runs.

                      Instances For
                        @[irreducible]

                        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
                          @[irreducible]
                          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
                              Instances For

                                A symbolic simulator for statements yielding a list of resulting environments.

                                Equations
                                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
                                    @[irreducible]
                                    def Core.Statement.Command.runCall (lhs : List Expression.Ident) (procName : String) (args : List Expression.Expr) (fuel : Nat) (E : Env) :

                                    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
                                      @[irreducible]
                                      def Core.Statement.Command.run (fuel : Nat) (E : Env) (c : Command) :
                                      Equations
                                      Instances For