X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=sidebyside;f=marco%20polo%2Fstatement.tex;h=2b323cee12f614064e59e47a9f7fcad3bd978763;hb=130735e9774c613cedbc6e059abc720cc9a2b6eb;hp=24fef61e38245423377bae395069ddbe38c18538;hpb=f226d96900b53bd05be3370f08d93f4c4cfa39f9;p=fireball-separation.git diff --git a/marco polo/statement.tex b/marco polo/statement.tex index 24fef61..2b323ce 100644 --- a/marco polo/statement.tex +++ b/marco polo/statement.tex @@ -7,6 +7,11 @@ \newcommand{\lc}[0]{{$\lambda$-calculus}} \newcommand{\bohm}[0]{{B\"ohm}} \newcommand{\TODO}[1]{\textcolor{red}{\textbf{TODO} #1}} +\newcommand{\fire}[0]{$\lambda_{\operatorname{fire}}$} + +\newcommand{\conv}[1]{=_{#1}} +\newcommand{\convb}[0]{\conv{\beta}} +\newcommand{\convbe}[0]{\conv{\beta\eta}} \usepackage{xcolor} \usepackage{amsmath, amsthm, amssymb} @@ -35,13 +40,13 @@ Segue una presentazione del progetto di ricerca che effettuerei presso il \texti \TODO{...} \end{abstract} -\section*{Introduction} +\section*{Background} % \subsubsection*{Lambda Calculus} - \textit{Pure lambda calculus} (which we call \lc) was originally conceived by Church, being intended as a general theory of functions which could serve as foundation for mathematics. + \textit{Pure lambda calculus} (which we call \lc) was originally conceived by Alonzo Church, being intended as a general theory of functions which could serve as foundation for mathematics. Its syntax is based on two basic conceptual operations: $\lambda$-abstraction and application. Since \lc{} can represent computable functions, it is considered an idealized functional programming language, where $\beta$-reduction corresponds to a computational step. - \TODO{In the following, we write $\equiv_\beta$ for equality of the terms up to $\alpha$-conversion (renaming of bound variables) and $\beta$-reduction. $\eta$-convertibility corresponds to extensionality, that means considering equal those functions which give same output on the same inputs.} + In the following, we say that $M \convb N$ if $M$ and $N$ are $\alpha\beta$-convertible ($\alpha$ being the renaming of bound variables). $\eta$-conversion allows expansion and contraction of the arguments of functions, and corresponds to function extensionality. A term is in \textit{normal form} when no more $\beta$-reductions are viable in it. \subsubsection*{Separation Theorem} Among the most important results for \lc{} (like fixpoint, Church-Rosser, and normalization theorems) is the \textit{separation theorem} (also known as \bohm's theorem \cite{bohm}). @@ -53,21 +58,21 @@ Segue una presentazione del progetto di ricerca che effettuerei presso il \texti \item normal forms can be explored by the only means of computational rules. \end{enumerate} - Intuitively, \bohm's theorem states that when two $\lambda$-terms are syntactically different, then one can put them in the context of a bigger $\lambda$ program s.t. they reduce to two clearly different terms. By \textit{context} (denoted by $E[\,]$) we mean a $\lambda$-term with a hole ($[\,]$ is the hole), such that $E[M]$ is the $\lambda$-term obtained by replacing in $E[\,]$ the holes $[\,]$ with $M$. + Intuitively, \bohm's theorem states that when two $\lambda$-terms are syntactically different, then one can put them in the context of a bigger $\lambda$ program such that they reduce to two clearly different terms. By \textit{context} (denoted by $E[\,]$) we mean a $\lambda$-term with a hole ($[\,]$ is the hole), such that $E[M]$ is the $\lambda$-term obtained by replacing in $E[\,]$ the hole $[\,]$ with $M$. \begin{theoren}[\bohm{} theorem] Let $M$, $N$ be $\beta\eta$-distinct $\lambda$-terms in normal form; then there exists a context $E[\,]$ such that: \[\begin{array}{ll} - E[M] & \equiv_{\beta} \operatorname{true} \text{, and}\\ - E[N] & \equiv_{\beta} \operatorname{false}, \\ + E[M] & \convb \operatorname{true} \text{, and}\\ + E[N] & \convb \operatorname{false}, \\ \end{array}\] where $\operatorname{true}:=\lambda x\,y.\,x$ and $\operatorname{false}:=\lambda x\,y.\,y$. \end{theoren} -The proof of this theorem is carried out by induction on so-called \textit{\bohm{} trees} (syntax trees computed from the normal forms), and by means of \textit{\bohm{} transformations}. The technique used in the proof is called ``\bohm-out'', and is a powerful tool that was applied to separation in other $\lambda$-theories. +The proof of this theorem is carried out by induction on so-called \textit{\bohm{} trees} (syntax trees computed from the normal forms), and by means of \textit{\bohm{} transformations}. The technique used in the proof is called ``\bohm-out'', and is a powerful tool that was applied to separation problems in other $\lambda$-theories. -Let's now make some remarks which will be useful in the last section. +Let us now make some remarks which will be useful in the last section. -Firstly, note that easy consequence of the theorem is the following: +Firstly, note that an easy consequence of the theorem is the following: \begin{corollary} Let $M$, $N$ be $\beta\eta$-distinct $\lambda$-terms in normal form; then there exists a context $E[\,]$ such that $E[M]$ has a normal form, and $E[N]$ has no normal form. @@ -80,7 +85,13 @@ It is now clear that \bohm's theorem actually states that, in the case of terms Note that the original proof of \bohm's theorem is \textit{constructive}: it consists of an actual algorithm which, given two $\beta\eta$-distinct $\lambda$-terms, constructs a corresponding discriminating context. Such algorithm was implemented in CAML in \cite{DBLP:journals/tcs/Huet93}, but to my knowledge it was never formalized in a \textit{proof assistant}. A formalization would yield a verified implementation (proven to be correct, and to comply with its specification) of the algorithm; in addition, it would add up to the pile of formalized mathematical knowledge, allowing other researchers to build on top of it. \subsubsection*{Abella} -The plan is to formalize \bohm's theorem in Abella. Abella is an interactive theorem prover based on lambda-tree syntax \cite{DBLP:conf/cade/Gacek08}, and it is intended for reasoning about object languages whose syntactic structure is presented through recursive rules. +The plan is to formalize \bohm's theorem in Abella. Abella is an interactive theorem prover based on $\lambda$-tree syntax \cite{DBLP:conf/cade/Gacek08}, and it is intended for reasoning about object languages whose syntactic structure is presented through recursive rules. + +The strenght of Abella is how it treats \textit{binding} in object languages: in fact, object-level binding are represented in Abella using \textit{meta-level abstraction}. This makes the encoding of object languages much more straightforward, since usual notions related to binding (such as $\alpha$-equivalence and capture-avoiding substitutions) are already built into the logic and need not be implemented again at the specification level. + +$\nabla$ + +As a matter of fact, Abella has been used effectively to formalize proofs in which objects with bindings must be manipulated in a fundamental way. For example, some results in \lc{} (subject reduction, uniqueness of typing, normalizability \`a la Tait) and proof theory (cut-admissibility). % Two-level logic approach.... @@ -88,17 +99,36 @@ The plan is to formalize \bohm's theorem in Abella. Abella is an interactive the \section*{Outcomes} +\TODO{\ldots, pro/contro Abella} + \section*{Future work} The computer formalization of \bohm{}'s theorem would be a convenient result on its own sake; nevertheless, it poses a solid starting point to provide formal proofs of similar separation results in other $\lambda$-theories and other $\lambda$-calculi. %, for example in extensions of \lc, or according to different evaluation strategies. - For example, the problem of separating $\lambda$-terms popped up inevitably while working with Prof. Claudio Sacerdoti Coen on the observational equality of a calculus in call-by-value called \textit{fireball calculus} \cite{fireball}. + For example, the problem of separating $\lambda$-terms popped up inevitably while working with Claudio Sacerdoti Coen and Beniamino Accattoli on the observational equality of the \textit{fireball calculus} \fire{} \cite{DBLP:conf/lics/AccattoliC15}. Our goal here is to provide a suitable notion of \textit{bisimulation} in order to characterize syntactically the equivalence of programs (i.e. contextual equivalence). + + \subsubsection*{The Fireball Calculus} + + \fire{} is an \textit{open} call-by-value \lc{}. Recall that \textit{call-by-value} is an evaluation strategy for the \lc{} in which - intuitively - functions' arguments are evaluated before the function call. \fire{} is similar to Plotkin's call-by-value \lc{}, which is at the foundation of programming languages (OCaml) and proof assistants (Coq), but \fire{} (as a \textit{weak calculus}, when reductions occur only outside abstractions) is particularly elegant because: + \begin{itemize} + \item it is \textit{strongly confluent}; + \item normal forms have a clean syntactic description as \textit{fireballs}: a fireball is either an abstractions (like values in Plotkin), or a variable possibly applied to other fireballs. + \end{itemize} + +Strong evaluation may be obtained as usual by iterating the weak one under abstractions. But, mainly because fireballs are not closed under substitutions, the strong calculus has some issues: +\begin{itemize} + \item it is \textit{not} confluent; + \item contextual equivalence is not closed under reduction. + % a term and its strong normal form may not be contextual equivalent (in the usual sense). + For example: \[(\lambda y.\,z) \, (x\, x) \to_{\beta} z ,\] but in a context replacing the free variable $x$ with $\lambda x.\, x\, x$, the term on the left diverges, and the one on the right converges. + +\end{itemize} - \TODO{} +Therefore, it is not easy to give a syntactic characterization of contextually equivalent terms. We are working on a separation algorithm which departs non-trivially from \bohm's theorem and other separation algorithms \TODO{[??? qui cit. i torinesi]}, and it would be the first (working) separation algorithm in call-by-value. \TODO{We are much done with designing but struggling to prove termination}. - \TODO{fireball calculus, and the algorithm we are dessigning} +The formalization of \bohm's theorem would provide a good starting point for the formalization of our own algorithm; this would assist us in proving that our separaation algorithm terminates and is correct. - Once done with the formalization, we will adapt the formal proof to the algorithm which we are currently designing for the fireball calculus. + % Once done with the formalization, we will adapt the formal proof to the algorithm which we are currently designing for the fireball calculus. % e si potrebbe estendere la prova al nostro mostro