Stack-based VM instructions.
- push_I : Instruction
- push_K : Instruction
- push_S : Instruction
- app : Instruction
Instances For
Equations
- ISAR.instReprInstruction.repr ISAR.Instruction.push_I prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "ISAR.Instruction.push_I")).group prec✝
- ISAR.instReprInstruction.repr ISAR.Instruction.push_K prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "ISAR.Instruction.push_K")).group prec✝
- ISAR.instReprInstruction.repr ISAR.Instruction.push_S prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "ISAR.Instruction.push_S")).group prec✝
- ISAR.instReprInstruction.repr ISAR.Instruction.app prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "ISAR.Instruction.app")).group prec✝
Instances For
Equations
- ISAR.instReprInstruction = { reprPrec := ISAR.instReprInstruction.repr }
Execute a list of bytecode instructions on a VM stack of TTerms.
Equations
- ISAR.run [] x✝ = x✝
- ISAR.run (ISAR.Instruction.push_I :: insts) x✝ = ISAR.run insts (ISAR.TTerm.I :: x✝)
- ISAR.run (ISAR.Instruction.push_K :: insts) x✝ = ISAR.run insts (ISAR.TTerm.K :: x✝)
- ISAR.run (ISAR.Instruction.push_S :: insts) x✝ = ISAR.run insts (ISAR.TTerm.S :: x✝)
- ISAR.run (ISAR.Instruction.app :: insts) (x_2 :: y :: stack) = ISAR.run insts (y.app x_2 :: stack)
- ISAR.run (ISAR.Instruction.app :: insts) x✝ = ISAR.run insts (ISAR.TTerm.I :: x✝)
Instances For
Step lemmas for VM execution when the stack is concrete.
Compile a bytecode program by running it on an empty stack and taking the top term.
Equations
- ISAR.compile_bytecode p = match ISAR.run p [] with | x :: tail => x | [] => ISAR.TTerm.I
Instances For
Decompile a TTerm into a list of postfix stack instructions.
Equations
Instances For
Theorem: Compiling a decompiled TTerm returns the original term.
Observational equivalence for bytecode programs (evaluating to equivalent terms).
Equations
- ISAR.bytecode_obs_eq p1 p2 = ISAR.OperEq (ISAR.trs_encode (ISAR.compile_bytecode p1)) (ISAR.trs_encode (ISAR.compile_bytecode p2))
Instances For
Observational equivalence is a setoid.
Setoid of bytecode observations.
Equations
- ISAR.bytecodeObsSetoid = { r := ISAR.bytecode_obs_eq, iseqv := ISAR.bytecode_obs_equiv }
Instances For
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
- ISAR.decode_bytecode q = Quotient.lift (fun (t : ISAR.ISKSubtype) => ⟦ISAR.decode_bytecode_raw t⟧) ISAR.decode_bytecode._proof_1 q
Instances For
The concrete Bytecode_Dialect : Dialect instance (computable; OperEq observations).
Equations
- One or more equations did not get rendered due to their size.