Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions specification/wasm-3.0/7.1-soundness.configurations.spectec
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ rule Instr_ok2/label:
rule Instr_ok2/frame:
s; C |- FRAME_ n `{f} instr* : eps -> t^n
-- Frame_ok: s |- f : C'
-- if C'.RETURN = t^n
-- Expr_ok2: s; C' |- instr* : t^n
-- Expr_ok2: s; {RETURN t^n} ++ C' |- instr* : t^n
-- Resulttype_ok: {} |- t^n : OK

rule Instr_ok2/handler:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ rule Instr_ok2/label:
rule Instr_ok2/frame:
s; C |- FRAME_ n `{f} instr* : eps -> t^n
-- Frame_ok: s |- f : C'
-- if C'.RETURN = t^n
-- Expr_ok2: s; C' |- instr* : t^n
-- Expr_ok2: s; {RETURN t^n} ++ C' |- instr* : t^n
-- Resulttype_ok: {} |- t^n : OK

rule Instr_ok2/handler:
Expand Down
31 changes: 15 additions & 16 deletions spectec/test-frontend/TEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -8286,54 +8286,53 @@ relation Instr_ok2: `%;%|-%:%`(store, context, instr, instrtype)
-- Instrs_ok2: `%;%|-%:%`(s, C, instr'*{instr' <- `instr'*`}, `%->_%%`_instrtype(`%`_resulttype(t'^n{t' <- `t'*`},), x'*{x' <- `x'*`}, `%`_resulttype(t*{t <- `t*`},)))
-- Instrs_ok2: `%;%|-%:%`(s, {TYPES [], TAGS [], GLOBALS [], MEMS [], TABLES [], FUNCS [], DATAS [], ELEMS [], LOCALS [], LABELS [`%`_resulttype(t'^n{t' <- `t'*`},)], RETURN ?(), REFS [], RECS []} +++ C, instr*{instr <- `instr*`}, `%->_%%`_instrtype(`%`_resulttype([],), x*{x <- `x*`}, `%`_resulttype(t*{t <- `t*`},)))

;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:37.1-42.35
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:37.1-41.35
rule frame{s : store, C : context, n : n, f : frame, `instr*` : instr*, `t*` : valtype*, C' : context}:
`%;%|-%:%`(s, C, `FRAME_%{%}%`_instr(n, f, instr*{instr <- `instr*`}), `%->_%%`_instrtype(`%`_resulttype([],), [], `%`_resulttype(t^n{t <- `t*`},)))
-- Frame_ok: `%|-%:%`(s, f, C')
-- if (C'.RETURN_context = ?(`%`_resulttype(t^n{t <- `t*`},)))
-- Expr_ok2: `%;%|-%:%`(s, C', instr*{instr <- `instr*`}, `%`_resulttype(t^n{t <- `t*`},))
-- Expr_ok2: `%;%|-%:%`(s, {TYPES [], TAGS [], GLOBALS [], MEMS [], TABLES [], FUNCS [], DATAS [], ELEMS [], LOCALS [], LABELS [], RETURN ?(`%`_resulttype(t^n{t <- `t*`},)), REFS [], RECS []} +++ C', instr*{instr <- `instr*`}, `%`_resulttype(t^n{t <- `t*`},))
-- Resulttype_ok: `%|-%:OK`({TYPES [], TAGS [], GLOBALS [], MEMS [], TABLES [], FUNCS [], DATAS [], ELEMS [], LOCALS [], LABELS [], RETURN ?(), REFS [], RECS []}, `%`_resulttype(t^n{t <- `t*`},))

;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:44.1-47.49
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:43.1-46.49
rule handler{s : store, C : context, n : n, `catch*` : catch*, `instr*` : instr*, `t*` : valtype*, `x*` : idx*}:
`%;%|-%:%`(s, C, `HANDLER_%{%}%`_instr(n, catch*{catch <- `catch*`}, instr*{instr <- `instr*`}), `%->_%%`_instrtype(`%`_resulttype([],), [], `%`_resulttype(t*{t <- `t*`},)))
-- (Catch_ok: `%|-%:OK`(C, catch))*{catch <- `catch*`}
-- Instrs_ok2: `%;%|-%:%`(s, C, instr*{instr <- `instr*`}, `%->_%%`_instrtype(`%`_resulttype([],), x*{x <- `x*`}, `%`_resulttype(t*{t <- `t*`},)))

;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:49.1-51.42
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:48.1-50.42
rule trap{s : store, C : context, `t_1*` : valtype*, `t_2*` : valtype*}:
`%;%|-%:%`(s, C, TRAP_instr, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 <- `t_1*`},), [], `%`_resulttype(t_2*{t_2 <- `t_2*`},)))
-- Instrtype_ok: `%|-%:OK`(C, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 <- `t_1*`},), [], `%`_resulttype(t_2*{t_2 <- `t_2*`},)))

;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:5.1-6.36
relation Instrs_ok2: `%;%|-%:%`(store, context, instr*, instrtype)
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:54.1-55.27
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:53.1-54.27
rule empty{s : store, C : context}:
`%;%|-%:%`(s, C, [], `%->_%%`_instrtype(`%`_resulttype([],), [], `%`_resulttype([],)))

;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:57.1-61.86
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:56.1-60.86
rule seq{s : store, C : context, instr_1 : instr, `instr_2*` : instr*, `t_1*` : valtype*, `x_1*` : idx*, `x_2*` : idx*, `t_3*` : valtype*, `t_2*` : valtype*, `init*` : init*, `t*` : valtype*}:
`%;%|-%:%`(s, C, [instr_1] ++ instr_2*{instr_2 <- `instr_2*`}, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 <- `t_1*`},), x_1*{x_1 <- `x_1*`} ++ x_2*{x_2 <- `x_2*`}, `%`_resulttype(t_3*{t_3 <- `t_3*`},)))
-- Instr_ok2: `%;%|-%:%`(s, C, instr_1, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 <- `t_1*`},), x_1*{x_1 <- `x_1*`}, `%`_resulttype(t_2*{t_2 <- `t_2*`},)))
-- (if (C.LOCALS_context[x_1!`%`_idx.0] = `%%`_localtype(init, t)))*{init <- `init*`, t <- `t*`, x_1 <- `x_1*`}
-- Instrs_ok2: `%;%|-%:%`(s, $with_locals(C, x_1*{x_1 <- `x_1*`}, `%%`_localtype(SET_init, t)*{t <- `t*`}), instr_2*{instr_2 <- `instr_2*`}, `%->_%%`_instrtype(`%`_resulttype(t_2*{t_2 <- `t_2*`},), x_2*{x_2 <- `x_2*`}, `%`_resulttype(t_3*{t_3 <- `t_3*`},)))

;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:63.1-67.33
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:62.1-66.33
rule sub{s : store, C : context, `instr*` : instr*, it' : instrtype, it : instrtype}:
`%;%|-%:%`(s, C, instr*{instr <- `instr*`}, it')
-- Instrs_ok2: `%;%|-%:%`(s, C, instr*{instr <- `instr*`}, it)
-- Instrtype_sub: `%|-%<:%`(C, it, it')
-- Instrtype_ok: `%|-%:OK`(C, it')

;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:70.1-73.33
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:69.1-72.33
rule frame{s : store, C : context, `instr*` : instr*, `t*` : valtype*, `t_1*` : valtype*, `x*` : idx*, `t_2*` : valtype*}:
`%;%|-%:%`(s, C, instr*{instr <- `instr*`}, `%->_%%`_instrtype(`%`_resulttype(t*{t <- `t*`} ++ t_1*{t_1 <- `t_1*`},), x*{x <- `x*`}, `%`_resulttype(t*{t <- `t*`} ++ t_2*{t_2 <- `t_2*`},)))
-- Instrs_ok2: `%;%|-%:%`(s, C, instr*{instr <- `instr*`}, `%->_%%`_instrtype(`%`_resulttype(t_1*{t_1 <- `t_1*`},), x*{x <- `x*`}, `%`_resulttype(t_2*{t_2 <- `t_2*`},)))
-- Resulttype_ok: `%|-%:OK`(C, `%`_resulttype(t*{t <- `t*`},))

;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:7.1-8.36
relation Expr_ok2: `%;%|-%:%`(store, context, expr, resulttype)
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:76.1-78.44
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:75.1-77.44
rule _{s : store, C : context, `instr*` : instr*, `t*` : valtype*}:
`%;%|-%:%`(s, C, instr*{instr <- `instr*`}, `%`_resulttype(t*{t <- `t*`},))
-- Instrs_ok2: `%;%|-%:%`(s, C, instr*{instr <- `instr*`}, `%->_%%`_instrtype(`%`_resulttype([],), [], `%`_resulttype(t*{t <- `t*`},)))
Expand Down Expand Up @@ -8409,30 +8408,30 @@ relation Exninst_ok: `%|-%:OK`(store, exninst)
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec
rec {

;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:226.1-227.50
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:225.1-226.50
relation ImmutReachable: `%>>_%%`(fieldval, store, fieldval)
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:240.1-243.35
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:239.1-242.35
rule trans{fv_1 : fieldval, s : store, fv_2 : fieldval, fv' : fieldval}:
`%>>_%%`(fv_1, s, fv_2)
-- ImmutReachable: `%>>_%%`(fv_1, s, fv')
-- ImmutReachable: `%>>_%%`(fv', s, fv_2)

;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:245.1-248.20
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:244.1-247.20
rule `ref.struct`{a : addr, s : store, i : nat, `ft*` : fieldtype*, zt : storagetype}:
`%>>_%%`(`REF.STRUCT_ADDR`_fieldval(a), s, s.STRUCTS_store[a].FIELDS_structinst[i])
-- Expand: `%~~%`(s.STRUCTS_store[a].TYPE_structinst, STRUCT_comptype(`%`_list(ft*{ft <- `ft*`},)))
-- if (ft*{ft <- `ft*`}[i] = `%%`_fieldtype(?(), zt))

;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:250.1-252.42
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:249.1-251.42
rule `ref.array`{a : addr, s : store, i : nat, zt : storagetype}:
`%>>_%%`(`REF.ARRAY_ADDR`_fieldval(a), s, s.ARRAYS_store[a].FIELDS_arrayinst[i])
-- Expand: `%~~%`(s.ARRAYS_store[a].TYPE_arrayinst, ARRAY_comptype(`%%`_fieldtype(?(), zt)))

;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:254.1-255.44
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:253.1-254.44
rule `ref.exn`{a : addr, s : store, i : nat}:
`%>>_%%`(`REF.EXN_ADDR`_fieldval(a), s, (s.EXNS_store[a].FIELDS_exninst[i] : val <: fieldval))

;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:257.1-258.28
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:256.1-257.28
rule `ref.extern`{ref : ref, s : store}:
`%>>_%%`(`REF.EXTERN`_fieldval(ref), s, (ref : ref <: fieldval))
}
Expand Down
4 changes: 1 addition & 3 deletions spectec/test-latex/TEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -14239,9 +14239,7 @@ $$
\frac{
s \vdash f : {C'}
\qquad
{C'}{.}\mathsf{return} = {t^{n}}
\qquad
s ; {C'} \vdash {{\mathit{instr}}^\ast} : {t^{n}}
s ; \{ \mathsf{return}~{t^{n}} \} \oplus {C'} \vdash {{\mathit{instr}}^\ast} : {t^{n}}
\qquad
\{ \} \vdash {t^{n}} : \mathsf{ok}
}{
Expand Down
Loading
Loading