Documentation

ISAR.BytecodeView

Stack-based VM instructions.

Instances For
    @[implicit_reducible]
    Equations

    Execute a list of bytecode instructions on a VM stack of TTerms.

    Equations
    Instances For

      Step lemmas for VM execution when the stack is concrete.

      theorem ISAR.run_app_one (insts : List Instruction) (x : TTerm) :
      theorem ISAR.run_app_two (insts : List Instruction) (x y : TTerm) (stack : List TTerm) :
      run (Instruction.app :: insts) (x :: y :: stack) = run insts (y.app x :: stack)

      Compile a bytecode program by running it on an empty stack and taking the top term.

      Equations
      Instances For
        theorem ISAR.run_concat (p1 p2 : List Instruction) (stack : List TTerm) :
        run (p1 ++ p2) stack = run p2 (run p1 stack)

        Lemma: Executing a concatenated program corresponds to staged execution.

        theorem ISAR.run_decompile_eq (t : TTerm) (stack : List TTerm) :
        run (decompile t) stack = t :: stack

        Lemma: Executing a decompiled TTerm on any stack pushes the term onto the stack.

        Theorem: Compiling a decompiled TTerm returns the original term.

        Observational equivalence for bytecode programs (evaluating to equivalent terms).

        Equations
        Instances For

          Observational equivalence is a setoid.

          Setoid of bytecode observations.

          Equations
          Instances For
            @[reducible, inline]

            Observation space: bytecode programs modulo observational equivalence.

            Equations
            Instances For

              Substrate term → bytecode program (computable).

              Equations
              Instances For

                Decode an OperEq-class to a bytecode observation. Well-defined via compile ∘ decompile = id and trs_encode ∘ decode_raw = id.

                Equations
                Instances For

                  The concrete Bytecode_Dialect : Dialect instance (computable; OperEq observations).

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