tix-papers/soundness/oracle.tex
2017-05-23 07:34:10 +02:00

64 lines
1.7 KiB
TeX

The type-system is defined in~\autoref{fig::oracle-type-system}.
\begin{figure}
\begin{mathpar}
\and\inferrule{ (x) \subtype t }{; \toracle x:t}(OVar)
\and\inferrule{ \Bt(c) \subtype t }{ \toracle c:t}(OConst)
\and\inferrule{%
\toracle e_2 : s \\
\toracle e_1 : s \rightarrow t
}{%
\toracle e_1~e_2 : t
}
(OApp)
\and\inferrule{%
t \subtype \zero \rightarrow \one \\
\forall s_1 \rightarrow s_2 \in \A(t), \\
' \dashv p:s_1 \\ ;' \toracle e : s_2
}{%
\toracle p.e : t
}(OAbs)
\and
\inferrule{%
\forall i \in \discrete{1}{n},
; x_1 : t_i \toracle e_i : t_i \\
; x_1 : t_1 \toracle e : t
}{%
\Gamma \toracle \text{let } x_1 = e_1 \text{ in } e : t
}
(OLet)
\and
\inferrule{%
\forall i \in \discrete{1}{n},
; x_1 : t_1; \ldots; x_n : t_n \toracle e_i : t_i \\
; x_1 : t_1; \cdots; x_n : t_n \toracle e : t
}{%
\Gamma \toracle \text{let } x_1 : t_1 = e_1; \ldots{}; x_n : t_n = e_n
\text{ in } e : t
}
(OLetAnnot)
\and\inferrule{%
\toracle e : t \\
t \not\subtype t \Rightarrow ; x : t \wedge \lnot t \toracle e_2 : s \\
t \not\subtype \lnot t \Rightarrow ; x : t \wedge t \toracle e_1 : s \\
}{%
\toracle (x = e \in t) ? e_1 : e_2 : s
}(OTcase)
\and\inferrule{%
\toracle e_1 : t_1 \\ \toracle e_2 : t_2 \\
t_2 \subtype \cons(\any, \any) \\
\cons(t_1, t_2) \subtype t
}{%
\toracle \cons(e_1, e_2) : t
}(OCons)
\end{mathpar}
\caption{The oracle type-system}\label{fig::oracle-type-system}
\end{figure}