on master help sign in
minor tinker
93ccf9aEdwin Brady
impl-paper/delab.tex+30−1
@@ -1,7 +1,29 @@
1−\section{Reversing Elaboration: From \TT{} to \Idris{}}
1+\section{Reversing Elaboration}
2
2
3\label{sect:delab}
3\label{sect:delab}
4
4
5+As well as translating from \Idris{} to \TT{}, so that programs can be type
6+checked and evaluated, it is valuable to define the reverse transformation. This
7+serves two principal purposes:
8+
9+\begin{itemize}
10+\item To assist the user, it is preferable that the results of evaluation, and any
11+error messages produced by the elaborator, are presented in \Idris{} syntax
12+rather than \TT{}.
13+\item For correctness, we would like to ensure as far as possible that the
14+result of elaboration is equivalent to the original program. Informally, we can
15+achieve this by checking that reversing the elaboration process yields the original
16+program (with implicit arguments expanded).
17+\end{itemize}
18+
19+\noindent
20+In this section, we describe the process for reversing elaboration and the required
21+properties of the elaboration process as a whole. Fortunately, translating from
22+\TT{} to \Idris{} is significantly easier than \Idris{} to \TT{}, because it is
23+primarily \emph{erasing} information.
24+
25+\subsection{From \TT{} to \Idris{}}
26+
5\subsection{Elaboration Properties}
27\subsection{Elaboration Properties}
6
28
7\todo[inline]{
29\todo[inline]{
@@ -11,3 +33,10 @@ an expression yields the original expression.
11(Works for expressions but not declarations)
33(Works for expressions but not declarations)
12}
34}
13
35
36+Properties:
37+\begin{itemize}
38+\item Elaboration produces a well-typed term
39+\item $\ve \MO{Matches} \uninterp{\ttinterp{\ve}}$
40+\end{itemize}
41+
42+
impl-paper/elaboration.tex+1
@@ -1,4 +1,5 @@
1\newcommand{\ttinterp}[1]{\mathcal{E}\interp{#1}}
1\newcommand{\ttinterp}[1]{\mathcal{E}\interp{#1}}
2+\newcommand{\uninterp}[1]{\mathcal{U}\interp{#1}}
2
3
3\section{Elaborating \Idris{}}
4\section{Elaborating \Idris{}}
4
5
impl-paper/impldtp.tex+1
@@ -129,6 +129,7 @@ implementation of new high level language constructs.
129
129
130This work was funded by the Scottish Informatics and Computer Science
130This work was funded by the Scottish Informatics and Computer Science
131Alliance (SICSA) and by EU Framework 7 Project No. 248828 (ADVANCE).
131Alliance (SICSA) and by EU Framework 7 Project No. 248828 (ADVANCE).
132+My thanks to Kevin Hammond for his comments on an earlier draft of this paper.
132
133
133\bibliographystyle{jfp}
134\bibliographystyle{jfp}
134\bibliography{library.bib}
135\bibliography{library.bib}