Skip to content
Merged
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
6 changes: 3 additions & 3 deletions document/core/appendix/properties.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,7 @@ To that end, all previous typing judgements :math:`C \vdash \X{prop}` are genera

.. math::
\frac{
C \vdashresulttype [t^n] : \OKresulttype
\{\} \vdashresulttype [t^n] : \OKresulttype
\qquad
S; [t^n] \vdashinstrs F; \instr^\ast : [t^n]
}{
Expand All @@ -1037,10 +1037,10 @@ To that end, all previous typing judgements :math:`C \vdash \X{prop}` are genera
\begin{array}{c}
(C \vdashcatch \catch : \OKcatch)^\ast
\qquad
S; C \vdashinstrs \instr^\ast : [t_1^\ast] \to [t_2^\ast] \\
S; C \vdashinstrs \instr^\ast : [] \to [t^\ast] \\
\end{array}
}{
S; C \vdashadmininstr \HANDLER_n\{\catch^\ast\}~\instr^\ast : [t_1^\ast] \to [t_2^\ast]
S; C \vdashadmininstr \HANDLER_n\{\catch^\ast\}~\instr^\ast : [] \to [t^\ast]
}


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

rule Instr_ok2/handler:
s; C |- HANDLER_ n `{catch*} instr* : eps -> t*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ rule Instr_ok2/frame:
s; C |- FRAME_ n `{f} instr* : eps -> t^n
-- Frame_ok: s |- f : C'
-- Expr_ok2: s; C' |- instr* : t^n
-- Resulttype_ok: {} |- t^n : OK

rule Instr_ok2/handler:
s; C |- HANDLER_ n `{catch*} instr* : eps -> t*
Expand Down
29 changes: 15 additions & 14 deletions spectec/test-frontend/TEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -8229,52 +8229,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:23.1-26.37
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:23.1-27.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')
-- Expr_ok2: `%;%|-%:%`(s, 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:28.1-31.49
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:29.1-32.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:33.1-35.42
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:34.1-36.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:38.1-39.27
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:39.1-40.27
rule empty{s : store, C : context}:
`%;%|-%:%`(s, C, [], `%->_%%`_instrtype(`%`_resulttype([]), [], `%`_resulttype([])))

;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:41.1-45.86
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:42.1-46.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:47.1-51.33
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:48.1-52.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:54.1-57.33
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:55.1-58.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:60.1-62.44
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:61.1-63.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 @@ -8350,30 +8351,30 @@ relation Exninst_ok: `%|-%:OK`(store, exninst)
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec
rec {

;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:208.1-209.50
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:209.1-210.50
relation ImmutReachable: `%>>_%%`(fieldval, store, fieldval)
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:222.1-225.35
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:223.1-226.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:227.1-230.20
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:228.1-231.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:232.1-234.42
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:233.1-235.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:236.1-237.44
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:237.1-238.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:239.1-240.28
;; ../../../../specification/wasm-latest/7.1-soundness.configurations.spectec:240.1-241.28
rule `ref.extern`{ref : ref, s : store}:
`%>>_%%`(`REF.EXTERN`_fieldval(ref), s, (ref : ref <: fieldval))
}
Expand Down
2 changes: 2 additions & 0 deletions spectec/test-latex/TEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -14153,6 +14153,8 @@ $$
s \vdash f : {C'}
\qquad
s ; {C'} \vdash {{\mathit{instr}}^\ast} : {t^{n}}
\qquad
\{ \} \vdash {t^{n}} : \mathsf{ok}
}{
s ; C \vdash {{\mathsf{frame}}_{n}}{\{ f \}}~{{\mathit{instr}}^\ast} : \epsilon \rightarrow {t^{n}}
} \, {[\textsc{\scriptsize Instr\_ok2{-}frame}]}
Expand Down
Loading
Loading