Tomáš Petříček and Vít Šefl
petricek@d3s.mff.cuni.cz | sefl@ksvi.mff.cuni.cz
@tomasp.net | https://tomasp.net



Unexpected interaction between subtyping and implicit nulls.
Sound in isolation!


If \(\langle e, s \rangle \rightarrow \langle e', s'\rangle\) and
also \(\langle e, s \rangle \rightarrow \langle e'', s''\rangle\)
then \(e'=e''\) and \(s'=s''\).

If \(\Gamma \vdash e : \tau\) and \(dom(\Gamma)\subseteq dom(s)\) and
\(\langle e, s \rangle \rightarrow^{*} \langle e', s'\rangle\)
then either
\(e'\) is a value or there exist \(e'', s''\) such
that \(\langle e', s' \rangle \rightarrow \langle e'', s''\rangle\).


\(\forall x\in\mathbb{N}.\Phi(x)\) if \(\Phi(0)\) and \(\Phi(x)\Rightarrow\Phi(x+1)\)
Show that \(\forall e\in\mathbb{E}.\Phi(e)\) by showing \(\Phi(e)\) holds for
leaves and \(\Phi(e_1),\ldots,\Phi(e_n) \Rightarrow \Phi(\texttt{op}(e_1, \ldots, e_n))\)
Show that \(\forall x.R(x) \Rightarrow \Phi(x)\) by showing \(\Phi(J)\) holds for axioms (no assumptions) and \(\Phi(x)\) follows from assumptions \(\Phi(x_1), \ldots, \Phi(x_n)\) for each rule \(\dfrac{x_1, \ldots, x_n}{x}\).




Induction over the structure of expressions


See details (PDF)
Remarks
Values do not reduce
Careful treatment of what rules could have been used



Induction over the derivation of \(\vdash\)


See details (PDF)
Remarks
Inversion lemma to know what values can have a given type


Induction over the derivation of \(\rightarrow\)


See details (PDF)
Remarks
Induction over reduction relation, assuming any
context \(\Gamma\) and type \(\tau\)

If \(\Gamma \vdash e : \tau\) and \(dom(\Gamma)\subseteq dom(s)\) and
\(\langle e, s \rangle \rightarrow^{*} \langle e', s'\rangle\)
then either
\(e'\) is a value or there exist \(e'', s''\) such
that \(\langle e', s' \rangle \rightarrow \langle e'', s''\rangle\).
Induction over \(\rightarrow^{*}\). Reduction preserves type (preservation) and thus becomes value or can continue further (progress).


