Changeset 1394

Oct 17, 2011, 4:50:44 PM (8 years ago)

reconfiguring of tables, and recalculation of ratios

2 edited


  • Deliverables/D4.2-4.3/reports/D4-2.tex

    r1375 r1394  
    468 Translation specific files (files relating to language semantics have been omitted).
    469 Syntax:
    470 \begin{center}
    471 \begin{tabular*}{\textwidth}{p{3.5cm}p{5.5cm}p{3.5cm}p{1cm}}
     470Translation specific files (files relating to language semantics have been omitted) are presented in Table~\ref{table.syntax}.
    472475Title & Description & O'Caml & Ratio \\
    476479\texttt{RTL/} & The syntax of RTL & \texttt{RTL/RTL.mli} & 0.41 \\
    477480\texttt{ERTL/} & The syntax of ERTL & \texttt{ERTL/ERTL.mli} & 0.13 \\
    478 \texttt{LTL/} & The syntax of LTL & \texttt{LTL/LTL.mli} & 0.13 \\
    479 \texttt{LIN/} & The syntax of LIN & \texttt{LIN/LIN.mli} & 0.36
    480 \end{tabular*}
    481 \end{center}
     481\texttt{LTL/} & The syntax of LTL & \texttt{LTL/LTL.mli} & 0.19\tnote{a} \\
     482\texttt{LIN/} & The syntax of LIN & \texttt{LIN/LIN.mli} & 0.31\tnote{a}
     485  \item[a] Includes \texttt{joint/Joint\_LTL\}.
     488\caption{Syntax files}
    482491Here, the O'Caml column denotes the O'Caml source file in the prototype compiler's implementation that corresponds to the Matita script in question.
    483492The ratios are the linecounts of the Matita file divided by the line counts of the corresponding O'Caml file.
    484493These are computed with \texttt{wc -l}, a standard Unix tool.
    486 \noindent
    487 Translations and utilities:
    488 \begin{center}
    489 \begin{tabular*}{\textwidth}{p{4.5cm}p{4.5cm}p{4.5cm}p{1cm}}
     494Translations and utilities are presented in Table~\ref{table.translation.utilities}.
    490499Title & Description & O'Caml & Ratio \\
    492501\texttt{RTLabs/} & The translation from RTLabs to RTL & \texttt{RTLabs/} & 1.61 \\
    493502\texttt{joint/} & Generic translation utilities & N/A & N/A \\
     503\texttt{joint/Joint\_LTL\} & Generic code for LTL and LIN languages & N/A & N/A \\
    494504\texttt{RTL/} & The translation from RTL to ERTL & \texttt{RTL/} & 0.88 \\
    495505\texttt{RTL/} & Elimination of tailcalls & \texttt{RTL/} & 2.08 \\
    496 \texttt{ERTL/} & The translation from ERTL to LTL & \texttt{ERTL/} & 3.46 \\
    497 \texttt{ERTL/} & Axiomatised graph colouring component & \texttt{common/} & 0.03\footnote{The majority of this file is axiomatised.} \\
     506\texttt{ERTL/} & The translation from ERTL to LTL & \texttt{ERTL/} & 1.1\tnote{a} \\
     507\texttt{ERTL/} & Axiomatised graph colouring component & \texttt{common/} & 0.03\tnote{b} \\
    498508\texttt{ERTL/} & Liveness analysis & \texttt{ERTL/} & 0.92 \\
    499 \texttt{LTL/} & The translation from LTL to LIN & \texttt{LTL/} & 0.75 \\
    500 \texttt{LIN/} & The translation from LIN to assembly language & \texttt{LIN/} 2.45 &
    501 \end{tabular*}
    502 \end{center}
     509\texttt{LTL/} & The translation from LTL to LIN & \texttt{LTL/} & 2.43\tnote{c} \\
     510\texttt{LIN/} & The translation from LIN to assembly language & \texttt{LIN/} & 0.41\tnote{c}
     513  \item[a] This figure includes the line count of \texttt{} and \texttt{}.
     514  \item[b] The majority of this file is axiomatised.
     515  \item[c] This figure includes the line count of \texttt{joint/Joint\_LTL\}.
     518\caption{Translation files.}
    503522Given that Matita code is much more verbose than O'Caml code, with explicit typing and inline proofs, we have achieved respectable line count ratios in the translation.
     523Some of these ratio, however, need explanation.
     524In particular, the RTLabs to RTL translation stands out.
     525Note that RTLabs is not subject to our abstraction process, and the language's syntax is fully explicated.
     526Further, the RTLabs to RTL translation is quite involved, including instruction selection.
     528Other, longer translations include the file \texttt{}.
     529This is actually the concatenation of the files \texttt{} and \texttt{} in the O'Caml source, hence its length.
     531Further, many translations are actually significantly shorter than their O'Caml counterparts due to axiomatisation, and the lack of structure and functor declarations in Matita.
     533We note that the O'Caml codebase consists of 26989 lines of O'Caml code (including comments).
     534The Matita codebase consists of 41959 lines of Matita code (including comments).
     535This is a ratio of 1.55 --- not bad considering the Matita code also includes implementations of data structures that are present in the O'Caml standard library, and some proofs.
  • Deliverables/D4.2-4.3/reports/D4-3.tex

    r1391 r1394  
    149149In particular, we have merged many of the syntaxes of the intermediate languages (i.e. RTL, ERTL, LTL and LIN) into a single `joint' syntax, which is parameterised by various types.
    150150Equivalent intermediate languages to those present in the O'Caml code can be recovered by specialising this joint structure.
     152As mentioned in the report for Deliverable D4.2, there are a number of advantages that this process of abstraction brings, from code reuse to allowing us to get a clearer view of the intermediate languages and their structure.
     153However, the semantics of the intermediate languages allow us to concretely demonstrate this improvement in clarity, by noting that the semantics of the LTL and the semantics of the LIN languages are identical.
     154In particular, the semantics of both LTL and LIN are implemented in exactly the same way.
     155The only difference between the two languages is how the next instruction to be interpreted is fetched.
     156In LTL, this involves looking up in a graph, whereas in LTL, this involves fetching from a list of instructions.
     158As a result, we see that the semantics of LIN and LTL are both instances of a single, more general language that is parametric in how the next instruction is fetched.
     159Furthermore, any prospective proof that the semantics of LTL and LIN are identical is not almost trivial, saving a deal of work in Deliverable D4.4.
    195204Most functions in the intermediate language semantics fall into the IO monad.
     206This monadic infrastructure is shared between the frontend and backend languages.
Note: See TracChangeset for help on using the changeset viewer.