X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fpapers%2Fmatita%2Fmatita2.tex;h=c9631a4105943a0e46e697a348c641b971aab4f9;hb=72789e6d0eca89aa6629b387da141feac426ba20;hp=04b7427a7dc995e246f93fde73a3a8947221ef79;hpb=7521a4856db25447fbcc50a29eacc61d6b1ad3ab;p=helm.git diff --git a/helm/papers/matita/matita2.tex b/helm/papers/matita/matita2.tex index 04b7427a7..c9631a410 100644 --- a/helm/papers/matita/matita2.tex +++ b/helm/papers/matita/matita2.tex @@ -1,4 +1,4 @@ -\documentclass[]{kluwer} +\documentclass[draft]{kluwer} \usepackage{color} \usepackage{graphicx} % \usepackage{amssymb,amsmath} @@ -18,6 +18,7 @@ \newcommand{\AUTO}{\textsc{Auto}} \newcommand{\COQ}{Coq} +\newcommand{\COQIDE}{CoqIde} \newcommand{\ELIM}{\textsc{Elim}} \newcommand{\GDOME}{Gdome} \newcommand{\HELM}{Helm} @@ -30,6 +31,8 @@ \newcommand{\LOCATE}{\textsc{Locate}} \newcommand{\MATCH}{\textsc{Match}} \newcommand{\MATITA}{Matita} +\newcommand{\MATITAC}{\texttt{matitac}} +\newcommand{\MATITADEP}{\texttt{matitadep}} \newcommand{\METAHEADING}{Symbol & Position \\ \hline\hline} \newcommand{\MOWGLI}{MoWGLI} \newcommand{\NAT}{\ensuremath{\mathit{nat}}} @@ -105,7 +108,7 @@ \institute{Department of Computer Science, University of Bologna\\ Mura Anteo Zamboni, 7 --- 40127 Bologna, ITALY} -\runningtitle{The Matita proof assistant} +\runningtitle{The \MATITA{} proof assistant} \runningauthor{Asperti, Sacerdoti Coen, Tassi, Zacchiroli} % \date{data} @@ -123,6 +126,7 @@ Digital Libraries} \end{opening} + \section{Introduction} \label{sec:intro} \MATITA{} is the Proof Assistant under development by the \HELM{} team @@ -163,7 +167,7 @@ active in the MathML Working group since 1999.}; \end{itemize} According to our content-centric commitment, the library exported from -Coq was conceived as being distributed and most of the tools were developed +\COQ{} was conceived as being distributed and most of the tools were developed as Web services. The user could interact with the library and the tools by means of a Web interface that orchestrates the Web services. @@ -205,7 +209,7 @@ DESCRIZIONE DEL SISTEMA DAL PUNTO DI VISTA ``UTENTE'' \begin{itemize} \item scelta del sistema fondazionale - \item sistema indipendente (da Coq) + \item sistema indipendente (da \COQ) \item compatibilit\`a con sistemi legacy \end{itemize} @@ -273,7 +277,8 @@ allow other developers to quickly understand our code and contribute. \end{center} \end{figure} -\section{Overview of the Architecture} +\section{Architecture} +\label{architettura} Fig.~\ref{fig:libraries} shows the architecture of the \emph{\components} (circle nodes) and \emph{applications} (squared nodes) developed in the HELM project. @@ -329,9 +334,9 @@ be satisfied by linking the \component{} in the same executable. For those \components{} whose functionalities are also provided by the aforementioned Web services, it is also possible to link stub code that forwards the request to a remote Web service. For instance, the Getter -is just a wrapper to the \texttt{getter} \component{} that allows the +is just a wrapper to the \GETTER \component{} that allows the \component{} to be used as a Web service. \MATITA{} can directly link the code -of the \texttt{getter} \component, or it can use a stub library with the same +of the \GETTER \component, or it can use a stub library with the same API that forwards every request to the Getter. To better understand the architecture of \MATITA{} and the role of each @@ -345,6 +350,7 @@ fully specified terms; partially specified terms; content level terms; presentation level terms. \subsection{Fully specified terms} +\label{fully-spec} \emph{Fully specified terms} are CIC terms where no information is missing or left implicit. A fully specified term should be well-typed. The mathematical notions (axioms, definitions, theorems) that are stored @@ -365,11 +371,11 @@ content level terms; presentation level terms. Terms may reference other mathematical notions in the library. One commitment of our project is that the library should be physically - distributed. The \texttt{getter} \component{} manages the distribution, + distributed. The \GETTER \component{} manages the distribution, providing a mapping from logical names (URIs) to the physical location of a notion (an URL). The \texttt{urimanager} \component{} provides the URI data type and several utility functions over URIs. The - \texttt{cic\_proof\_checking} \component{} calls the \texttt{getter} + \texttt{cic\_proof\_checking} \component{} calls the \GETTER \component{} every time it needs to retrieve the definition of a mathematical notion referenced by a term that is being type-checked. @@ -408,7 +414,7 @@ content level terms; presentation level terms. of preserving the coherence of the library and the database. For instance, when a notion is removed, all the notions that depend on it and their metadata are removed from the library. This aspect will be better detailed - in Sect.~\ref{decompilazione}. + in Sect.~\ref{sec:libmanagement}. \subsection{Partially specified terms} \emph{Partially specified terms} are CIC terms where subterms can be omitted. @@ -597,7 +603,7 @@ of commands to declare and activate new notations and it implements the semantics of these commands. It also implements undoing of the semantic actions. Among the commands there are hints to the disambiguation algorithm that are used to control and speed up disambiguation. -These mechanisms will be further discussed in Sect.~\ref{disambiguazione}. +These mechanisms will be further discussed in Sect.~\ref{sec:disambiguation}. Finally, the \texttt{grafite\_parser} \component{} implements a parser for the concrete syntax of the commands of \MATITA. The parser process a stream @@ -634,11 +640,11 @@ services missing from the standard library of the programming language. In particular, the \texttt{xml} \component{} is used to easily represent, parse and pretty-print XML files. -\section{Using \MATITA} +\section{Using \MATITA (boh \ldots cambiare titolo)} \begin{figure}[t] \begin{center} - \includegraphics[width=0.9\textwidth]{a.eps} +% \includegraphics[width=0.9\textwidth]{a.eps} \caption{\MATITA{} screenshot} \label{fig:screenshot} \end{center} @@ -665,6 +671,7 @@ the system to guide the user through the relevant parts of the library. This methodological assumption has many important consequences which will be discussed in the next section. + %on one side %it requires functionalities for the overall management of the library, %%%%%comprising efficient indexing techniques to retrieve and filter the @@ -674,40 +681,463 @@ which will be discussed in the next section. %techniques for interpreting the user inputs. %In the next two sections we shall separately discuss the two previous %points. + +%In order to maximize accessibility mathematical objects are encoded in XML. (As%discussed in the introduction,) the modular architecture of \MATITA{} is +%organized in components which work on data in this format. For instance the +%rendering engine, which transform $\lambda$-terms encoded as XML document to +%MathML Presentation documents, can be used apart from \MATITA{} to print ... +%FINIRE + A final section is devoted to some innovative aspects of the authoring system, such as a step by step tactical execution, content selection and copy-paste. -\section{Library Managament} +\section{Library Management} + \subsection{Indexing and searching} -\subsection{Developments} + + +\subsection{Compilation and decompilation} +\label{sec:libmanagement} + +% +%goals: consentire sviluppo di una librearia mantenendo integrita' referenziale e usando le teconologie nostre (quindi con metadati, XML, libreria visibile) +%\subsubsection{Composition} +%scripts.ma, .moo, XML, metadata +%\subsubsection{Compilation} +%analogie con compilazione classica dso.\\ +%granularita' differenti per uso interattivo e non +%\paragraph{Batch} +%- granularita' .ma/buri \\ +%-- motivazioni\\ +%- come si calcolano le dipendenze\\ +%- quando la si usa\\ +%- metodi (cc e clean)\\ +%- garanzie +%\paragraph{Interactive} +%- granularita' fine\\ +%-- motivazioni +%\label{sec:libmanagement} +%consistenza: integrita' referenziale +%Goals: mantenere consistente la rappresentazione della libreria su memoria persistente consentendo di compilare e decompilare le compilation unit (.ma).\\ +%Vincoli: dipendenze oggetti-oggetti e metadati-oggetti\\ +%Due livelli di gestione libreria, uno e' solo in fase interattiva dove la compilazione e' passo passo: \\ +%--- granularita' oggetto per matita interactive\\ +%--- granularita' baseuri (compilation unit) per la libreria\\ +%In entrmbi i casi ora:\\ +%--- matitaSync: add, remove, timetravel(facility-macro tra 2 stati)[obj]\\ +%--- matitaCleanLib: clean\_baseuri (che poi usa matitaSync a sua volta)[comp1]\\ +%Vincoli di add: typecheck ( ==$>$ tutto quello che usa sta in lib)\\ +%Vincoli di remove: \\ +%--- la remove di mSync non li controlla (ma sa cosa cancellare per ogni uri)\\ +%--- la clean\_baseuri calcola le dipendenze con i metadati (o anche i moo direi) e li rispetta\\ +%Undo di matita garantisce la consistenza a patto che l'history che tiene sia ok\\ +%Undo della lib (mClean) garantisce la consistenza (usando moo o Db).\\ + +The aim of this section is to describe the way \MATITA{} +preserves the consistency and the availability of the library +using the \WHELP{} technology, in response to the user addition or +removal of mathematical objects. + +As already sketched in \ref{fully-spec} the output of the +compilation of a script is split among two storage media, a +classical filesystem and a relational database. The former is used to +store the XML encoding of the objects defined in the script, the +disambiguation aliases and the interpretation and notational convention defined, +while the latter is used to store all the metadata needed by +\WHELP{}. +% Non serve piu' l'update: by --Zack +% In addition the \GETTER{} component +% should be updated with the the new mapping between the logical URI +% and the physical path of objects. + +While this kind of consistency has nothing to do with the nature of +the content of the library and is thus uninteresting (but really +tedious to implement and keep bug-free), there is a deeper +notion of mathematical consistency we need to provide. Each object +must reference only defined object (i.e. each proof must use only +already proved theorems). + +We will focus on how \MATITA{} ensures the interesting kind +of consistency during the formalization of a mathematical theory, +giving the user the freedom of adding, removing, modifying objects +without loosing the feeling of an always visible and browsable +library. + +\subsubsection{Compilation} + +The typechecker component guarantees that if an object is well typed +it depends only on well typed objects available in the library, +that is exactly what we need to be sure that the logic consistency of +the library is preserved. We have only to find the right order of +compilation of the scripts that compose the user development. + +For this purpose we provide a tool called \MATITADEP{} +that takes in input the list of files that compose the development and +outputs their dependencies in a format suitable for the GNU \texttt{make} tool. +The user is not asked to run \MATITADEP{} by hand, but +simply to tell \MATITA{} the root directory of his development (where all +script files can be found) and \MATITA{} will handle all the compilation +related tasks, including dependencies calculation. +To compute dependencies it is enough to look at the script files for +inclusions of other parts of the development or for explicit +references to other objects (i.e. with explicit aliases, see +\ref{sec:disambaliases}). + +The output of the compilation is immediately available to the user +trough the \WHELP{} technology, since all metadata are stored in a +user-specific area of the database where the search engine has read +access, and all the automated tactics that operates on the whole +library, like \AUTO, have full visibility of the newly defined objects. + +Compilation is rather simple, and the only tricky case is when we want +to compile again the same script, maybe after the removal of a +theorem. Here the policy is simple: decompile it before recompiling. +As we will see in the next section decompilation will ensure that +there will be no theorems in the development that depends on the +removed items. + +\subsubsection{Decompilation} + +Decompiling an object involves the (recursive) +decompilation of all the objects that depend on it. + +The calculation of the reverse dependencies can be computed in two +ways, using the relational database or using a simpler set of metadata +that \MATITA{} saves in the filesystem as a result of compilation. The +former technique is the same used by the \emph{Dependency Analyzer} +described in \cite{zack-master} and really depends on a relational +database. + +The latter is a fall-back in case the database is not available.\footnote{Due to +the complex deployment of a large piece of software like a database, +it is a common practice for the \HELM{} team to use a shared remote +database, that may be unavailable if the user workstation lacks +network connectivity.} This facility has to be intended only as a fall-back, +since the queries of the \WHELP{} technology depend require a working database. + +Decompilation guarantees that if an object is removed there are no +dandling references to it, and that the part of the library still +compiled is logically consistent. Since decompilation involves the +removal of all the results of the compilation, metadata included, the +library browsable trough the \WHELP{} technology is always kept up to date. + +\subsubsection{Interactive and batch (de)compilation} + +\MATITA{} includes an interactive graphical interface and a batch +compiler (\MATITAC). Only the former is intended to be used directly by the +user, the latter is automatically invoked when a +part of the user development is required (for example issuing an +\texttt{include} command) but not yet compiled. + +While they share the same engine for compilation and decompilation, +they provide different granularity. The batch compiler is only able to +compile a whole script file and reciprocally to decompile only a whole +script, and consequently all the other scripts that rely on an object +defined in it. The interactive interface is able to execute single steps +of compilation, that may include the definition of an object, and +consequently to undo single steps, thus removing single objects. + \subsection{Automation} -\subsection{Naming} + +\subsection{\MATITA's naming convention} +A minor but not entirely negligible aspect of \MATITA{} is that of +adopting a (semi)-rigid naming convention for identifiers, derived by +our studies about metadata for statements. +The convention is only applied to identifiers for theorems +(not definitions), and relates the name of a proof to its statement. +The basic rules are the following: +\begin{itemize} +\item each identifier is composed by an ordered list of (short) +names occurring in a left to right traversal of the statement; +\item all identifiers should (but this is not strictly compulsory) +separated by an underscore, +\item identifiers in two different hypothesis, or in an hypothesis +and in the conlcusion must be separated by the string ``\verb+_to_+''; +\item the identifier may be followed by a numerical suffix, or a +single or duoble apostrophe. + +\end{itemize} +Take for instance the theorem +\[\forall n:nat. n = plus \; n\; O\] +Possible legal names are: \verb+plus_n_O+, \verb+plus_O+, +\verb+eq_n_plus_n_O+ and so on. +Similarly, consider the theorem +\[\forall n,m:nat. n