Advertisement
Guest User

Untitled

a guest
Sep 12th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 3.69 KB | None | 0 0
  1. \begin{figure}[p]
  2.    \begin{leftfullpage}
  3.        \begin{footnotesize}
  4.            \noindent Statement: \hfill\framebox{$\Phi;\Gamma \vdash \HL{s} : t$}
  5.            \begin{mathpar}
  6.                \inferrule*[left=TS-Skip]
  7.                {
  8.                }
  9.                {
  10.                    \Phi;\Gamma |- \HL{\codebf{skip}} : \bot
  11.                }
  12.                \and
  13.                \inferrule*[left=TS-Ret]
  14.                {
  15.                    \Phi;\Gamma |- \HL{e} : t
  16.                }
  17.                {
  18.                    \Phi;\Gamma |- \HL{\codebf{return}\ e;} : t
  19.                }
  20.                \and
  21.                \inferrule*[left=TS-Expr]
  22.                {
  23.                    \Phi;\Gamma |- \HL{e} : t \\
  24.                    \Phi;\Gamma |- \HL{s} : t_r
  25.                }
  26.                {
  27.                    \Phi;\Gamma |- \HL{e;\ s} : t_r
  28.                }
  29.                \and
  30.                \inferrule*[left=TS-Decl]
  31.                {
  32.                    \Phi;\Gamma[x \mapsto t] |- \HL{s} : t_r
  33.                }
  34.                {
  35.                    \Phi;\Gamma |- \HL{t\ x;\ s} : t_r
  36.                }
  37.                \and
  38.                \inferrule*[left=TS-Assign]
  39.                {
  40.                    x : t \in \Gamma \\
  41.                    \Phi;\Gamma |- \HL{e} : t \\
  42.                    \Phi;\Gamma |- \HL{s} : t_r
  43.                }
  44.                {
  45.                    \Phi;\Gamma |- \HL{x = e;\ s} : t_r
  46.                }
  47.                \and
  48.                \inferrule*[left=TS-If]
  49.                {
  50.                    \Phi;\Gamma |- \HL{e} : \codebf{bool} \\
  51.                    \Phi;\Gamma |- \HL{s_t} : \bot \\
  52.                    \Phi;\Gamma |- \HL{s_f} : \bot \\
  53.                    \Phi;\Gamma |- \HL{s_r} : t_r
  54.                }
  55.                {
  56.                    \Phi;\Gamma |- \HL{\codebf{if}\ (e)\ s_t\ \codebf{else}\ s_f\ s_r} : t_r
  57.                }
  58.                \and
  59.                \inferrule*[left=TS-While]
  60.                {
  61.                    \Phi;\Gamma |- \HL{e} : \codebf{bool} \\
  62.                    \Phi;\Gamma |- \HL{s_b} : \bot \\
  63.                    \Phi;\Gamma |- s_r : t_r
  64.                }
  65.                {
  66.                    \Phi;\Gamma |- \HL{\codebf{while}\ (e)\ s_b\ s_r} : t_r
  67.                }
  68.            \end{mathpar}
  69.            \hrule
  70.            \smallskip
  71.            \noindent Expression: \hfill\framebox{$\Phi;\Gamma \vdash \HL{e} : t$}
  72.            \begin{mathpar}
  73.                \inferrule*[left=TE-Var]
  74.                {
  75.                    x : t \in \Gamma
  76.                }
  77.                {
  78.                    \Phi;\Gamma |- \HL{x} : t
  79.                }
  80.                \and
  81.                \inferrule*[left=TE-Val]
  82.                {
  83.                }
  84.                {
  85.                    \Phi;\Gamma |- \HL{\val_t} : t
  86.                }
  87.                \and
  88.                \inferrule*[left=TE-Call]
  89.                {
  90.                    \HL{t_r\ \ell(t_1\ x_1,\ldots,t_n\ x_n)\ \{\ s\ \}} \in \Phi \\
  91.                    \Phi;\Gamma |- \HL{e_1} : t_1 \\
  92.                    \cdots \\
  93.                    \Phi;\Gamma |- \HL{e_n} : t_n
  94.                }
  95.                {
  96.                    \Phi;\Gamma |- \HL{\ell(e_1,\ldots,e_n)} : t_r
  97.                }
  98.                \and
  99.                \inferrule*[left=TE-Stmt]
  100.                {
  101.                    \Phi;\Gamma |- \HL{s} : t
  102.                }
  103.                {
  104.                    \Phi;\Gamma |- \HL{\stmtexpr{s}{\sigma}} : t
  105.                }
  106.            \end{mathpar}
  107.        \end{footnotesize}%
  108.         \caption{Typing in \imp}
  109.        \label{sierra:fig:rules_t_imp}
  110.    \end{leftfullpage}
  111. \end{figure}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement