Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor refactor of context rules #130

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions spectec/spec/wasm-3.0/8-reduction.watsup
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,13 @@ rule Eval_expr:

;; Context

rule Step/ctxt-vals:
z; val+ instr* ~> z'; val+ instr'*
-- Step: z; instr* ~> z'; instr'*

rule Step/ctxt-instrs:
z; val* instr* instr_1* ~> z'; val* instr'* instr_1*
z; instr* instr_1+ ~> z'; instr'* instr_1+
-- Step: z; instr* ~> z'; instr'*
-- if val* =/= eps \/ instr_1* =/= eps

rule Step/ctxt-label:
z; (LABEL_ n `{instr_0*} instr*) ~> z'; (LABEL_ n `{instr_0*} instr'*)
Expand Down Expand Up @@ -244,9 +247,11 @@ rule Step/throw:
rule Step_read/throw_ref-null:
z; (REF.NULL ht) THROW_REF ~> TRAP

rule Step_read/throw_ref-vals:
z; val+ (REF.EXN_ADDR a) THROW_REF ~> (REF.EXN_ADDR a) THROW_REF

rule Step_read/throw_ref-instrs:
z; val* (REF.EXN_ADDR a) THROW_REF instr* ~> (REF.EXN_ADDR a) THROW_REF
-- if val* =/= eps \/ instr* =/= eps
z; (REF.EXN_ADDR a) THROW_REF instr+ ~> (REF.EXN_ADDR a) THROW_REF

rule Step_read/throw_ref-label:
z; (LABEL_ n `{instr'*} (REF.EXN_ADDR a) THROW_REF) ~> (REF.EXN_ADDR a) THROW_REF
Expand Down Expand Up @@ -288,9 +293,11 @@ rule Step_pure/handler-vals:

;; Traps

rule Step_pure/trap-vals:
val+ TRAP ~> TRAP

rule Step_pure/trap-instrs:
val* TRAP instr* ~> TRAP
-- if val* =/= eps \/ instr* =/= eps
TRAP instr+ ~> TRAP

rule Step_pure/trap-label:
(LABEL_ n `{instr'*} TRAP) ~> TRAP
Expand Down
Loading