98 lines
4.1 KiB
TeX
98 lines
4.1 KiB
TeX
% Created 2020-02-17 Mon 17:30
|
|
% Intended LaTeX compiler: pdflatex
|
|
\documentclass[11pt]{article}
|
|
\usepackage[utf8]{inputenc}
|
|
\usepackage[T1]{fontenc}
|
|
\usepackage{graphicx}
|
|
\usepackage{grffile}
|
|
\usepackage{longtable}
|
|
\usepackage{wrapfig}
|
|
\usepackage{rotating}
|
|
\usepackage[normalem]{ulem}
|
|
\usepackage{amsmath}
|
|
\usepackage{textcomp}
|
|
\usepackage{amssymb}
|
|
\usepackage{capt-of}
|
|
\usepackage{hyperref}
|
|
\usepackage[utf8]{inputenc}
|
|
\usepackage{algorithm}
|
|
\usepackage{algpseudocode}
|
|
\usepackage{amsmath,amssymb,amsthm}
|
|
\newtheorem{definition}{Definition}
|
|
\usepackage{graphicx}
|
|
\usepackage{listings}
|
|
\usepackage{color}
|
|
\author{Francesco Mecca}
|
|
\date{}
|
|
\title{Translation Verification of the OCaml pattern matching compiler}
|
|
\hypersetup{
|
|
pdfauthor={Francesco Mecca},
|
|
pdftitle={Translation Verification of the OCaml pattern matching compiler},
|
|
pdfkeywords={},
|
|
pdfsubject={},
|
|
pdfcreator={Emacs 26.3 (Org mode 9.1.9)},
|
|
pdflang={English}}
|
|
\begin{document}
|
|
|
|
\maketitle
|
|
\section{{\bfseries\sffamily TODO} Scaletta [1/2]}
|
|
\label{sec:org5a6f376}
|
|
\begin{itemize}
|
|
\item[{$\boxtimes$}] Abstract
|
|
\item[{$\square$}] Introduction [0\%]
|
|
\begin{itemize}
|
|
\item[{$\square$}] Ocaml
|
|
\item[{$\square$}] Pattern matching
|
|
\item[{$\square$}] Translation Verification
|
|
\item[{$\square$}] Symbolic execution
|
|
\end{itemize}
|
|
\end{itemize}
|
|
|
|
\begin{abstract}
|
|
|
|
This dissertation presents an algorithm for the translation validation of the OCaml
|
|
pattern matching compiler. Given the source representation of the target program and the
|
|
target program compiled in untyped lambda form, the algoritmhm is capable of modelling
|
|
the source program in terms of symbolic constraints on it's branches and apply symbolic
|
|
execution on the untyped lambda representation in order to validate wheter the compilation
|
|
produced a valid result.
|
|
In this context a valid result means that for every input in the domain of the source
|
|
program the untyped lambda translation produces the same output as the source program.
|
|
The input of the program is modelled in terms of symbolic constraints closely related to
|
|
the runtime representation of OCaml objects and the output consists of OCaml code
|
|
blackboxes that are not evaluated in the context of the verification.
|
|
|
|
\end{abstract}
|
|
|
|
\section{Introduction}
|
|
\label{sec:orgef00ecd}
|
|
|
|
\subsection{{\bfseries\sffamily TODO} OCaml}
|
|
\label{sec:org5659ec2}
|
|
Objective Caml (OCaml) is a dialect of the ML (Meta-Language) family of programming
|
|
languages.
|
|
OCaml shares many features with other dialects of ML, such as SML and Caml Light,
|
|
The main features of ML languages are the use of the Hindley-Milner type system that
|
|
provides with respect to static type systems of traditional imperative and/or object
|
|
oriented language such as C, C++ and Java many advantages such as:
|
|
\begin{itemize}
|
|
\item Parametric polymorphism: in certain scenarios a function can accept more than one
|
|
type for the input parameters. For example a function that computes the lenght of a
|
|
list doesn't need to inspect the type of the elements of the list and for this reason
|
|
a List.length function can accept list of integers, list of strings and in general
|
|
list of any type. Such languages offer polymorphic functions through subtyping at
|
|
runtime only, while other languages such as C++ offer polymorphism through compile
|
|
time templates and function overloading.
|
|
With the Hindley-Milner type system each well typed function can have more than one
|
|
type but always has a unique best type, called the \emph{principal type}.
|
|
For example the principal type of the List.length function is "For any \emph{a}, function from
|
|
list of \emph{a} to \emph{int}" and \emph{a} is called the \emph{type parameter}.
|
|
\item Strong typing: Languages such as C and C++ allow the programmer to operate on data
|
|
without considering its type, mainly through pointers. Other languages such as C\#
|
|
and Go allow type erasure so at runtime the type of the data can't be queried.
|
|
In the case of programming languages using an Hindley-Milner type system the
|
|
programmer is not allowed to operate on data by ignoring or promoting its type.
|
|
\item Type Inference: the principal type of a well formed term can be inferred without any
|
|
annotation or declaration.
|
|
\end{itemize}
|
|
\end{document}
|