forked from cajal-technologies/talos
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWasmWP.lean
More file actions
26 lines (20 loc) · 895 Bytes
/
Copy pathWasmWP.lean
File metadata and controls
26 lines (20 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import CodeLib.SepLogic.WasmHeap
import CodeLib.SepLogic.WasmRules
import Interpreter.Wasm
/-! # Prop-level Weakest Precondition for Wasm
`wp_wasm_prop` — the fuel-abstracted Prop-level weakest precondition:
some fuel exists under which the program runs to completion (fallthrough
or return) in a state satisfying `Q`. This is the layer program proofs
compose in: see the `wp_wasm_prop_*` rules in `Adequacy.lean`, which also
defines the iProp-level `wp_wasm` fixpoint and the adequacy bridge from
it down to this predicate. -/
namespace Wasm.SepLogic
open Iris Wasm
def wp_wasm_prop (m : Module) (st : Store Unit) (locals : Locals)
(prog : Program) (env : HostEnv Unit)
(Q : Store Unit → List Value → Prop) : Prop :=
∃ fuel, match exec fuel m st locals prog env with
| .Fallthrough st' _ => Q st' []
| .Return st' vals => Q st' vals
| _ => False
end Wasm.SepLogic