X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fmathql%2Fdoc%2Fmathql_introduction.tex;h=73086dba7600f8c749678a020c27a7736ce6cf0a;hb=4167cea65ca58897d1a3dbb81ff95de5074700cc;hp=a989a5ece5d52792ad4b9df2a518db45da3faeb7;hpb=e5632ea17a3a417084b1b12d3c5b1cc0f8bf78c3;p=helm.git diff --git a/helm/mathql/doc/mathql_introduction.tex b/helm/mathql/doc/mathql_introduction.tex index a989a5ece..73086dba7 100644 --- a/helm/mathql/doc/mathql_introduction.tex +++ b/helm/mathql/doc/mathql_introduction.tex @@ -1,192 +1,24 @@ \section{Introduction} This paper presents {\MathQL} version 4 which is the latest version of the -language, fully developed by Ferruccio Guidi. +language, fully developed by the Author. For a description of the previous versions of {\MathQL} see: \cite{Gui03} (version 3), \cite{GS03} (version 2), \cite{Lor02} (version 1). The main novelties of this version are the elimination of some cast operators -(producing a substantial simplification in the query structure and semantics, -see \secref{Operational}), a clear distinction between the core language and -the auxiliary functions of the basic library, a support for query generating -functions, the possibility of extending the language adding new libraries of -functions and a more uniform textual syntax. +(producing a substantial simplification in the query structure and semantics), +a clear distinction between the core language and the auxiliary functions of +the basic library, a support for query generating functions, the possibility +of extending the language adding new libraries of functions and a more uniform +textual syntax. {\MathQL}.4 incorporates the features of {\MathQL}.3 not documented on paper% \footnote {See the ``what's new'' section of {\MathQL} Web Site: -\URI{helm.cs.unibo.it/mathql}.} +\CURI{helm.cs.unibo.it/mathql}.} and adds some new features improving {\MathQL} capabilities to post-process the query results. -\subsection{Textual syntax} - -The syntax of grammatical productions resembles BNF and POSIX notation: - -\begin{itemize} - -\item -\TT{::=} defines a grammatical production by means of a regular expression. - -Regular expressions are made of the following elements -(here \TT{...} is a placeholder): - -% \item -% \TT{.} represents any character between U 0020 and U 007F inclusive; - -\item -\TT{`...`} represents any character in a character set; - -\item -\verb+`^ ...`+ represents any character (U+0020 to U+007E) not in a character -set; - -\item -\TT{"..."} represents a string to be matched verbatim; - -\item -\GP{...} represents a regular expression defined by a grammatical production; - -\item -\TT{... ...} represents a conjunctive regular expression; - -\item -\TT{... | ...} represents a disjunctive regular expression; - -\item -\TT{[ ... ]?} represents an optional regular expression; - -\item -\TT{[ ... ]+} represents a regular expression to be repeated one or more times; - -\item -\TT{[ ... ]*} represents a regular expression to be repeated zero or more times; - -\item -\TT{[ ... ]} represents a grouped regular expression. - -\end{itemize} - -\noindent -{\MathQL} Expressions can contain quoted constant strings with the syntax of -\figref {StrTS}.% -\footnote{Note that the first slash of the \GP{path} is not optional as -in {\MathQL}.3.} - -\begin{figure}[ht] -\begin{footnotesize} \begin{verbatim} - ::= '0 - 9' - ::= [ ]* - ::= | 'A - F' | 'a - f' - ::= "u" | '"' | "\" | "^" - ::= '"' [ "\" "^" | '^ "\^' ]* '"' - ::= "/" | [ "/" ]+ -\end{verbatim} \end{footnotesize} -\vskip-1pc -\caption{Textual syntax of numbers, strings and paths} \label{StrTS} -\end{figure} - -\noindent -The meaning of the escaped sequences is shown in \figref{EscTS} -(where $ .... $ is a 4-digit placeholder). - -\begin{figure}[ht] -\begin{footnotesize} -\begin{center} \begin{tabular}{|l|l|c|} -\hline {\bf Escape sequence} & {\bf Unicode character} & {\bf Text} \\ -\hline \verb+\u....^+ & U+.... & \\ -\hline \verb+\"^+ & U+0022 & \verb+"+ \\ -\hline \verb+\\^+ & U+005C & \verb+\+ \\ -\hline \verb+\^^+ & U+005E & \verb+^+ \\ -\hline -\end{tabular} \end{center} -\end{footnotesize} -\vskip-1pc -\caption{Textual syntax of escaped characters} \label{EscTS} -\end{figure} - -{\MathQL} character escaping syntax aims at complying with W3C character model -for the World Wide Web \cite{W3Ca} which recommends a support for standard -Unicode characters (U+0000 to U+FFFF) and escape sequences with -start/end delimiters. -In particular {\MathQL} escape delimiters (backslash and caret) are chosen -among the {\em unwise} characters for URI references (see \cite{URI}) because -URI references are the natural content of constant strings and these -characters should not be so frequent in them. - -Query expressions can contain variables for {\av}'s (production \GP{avar}) -and variables for {\av} sets, {\ie} for query results (production \GP{svar}) -according to the syntax of \figref{VarTS}. - -\begin{figure}[ht] -\begin{footnotesize} \begin{verbatim} - ::= [ 'A - Z' | 'a - z' | `_` ]+ - ::= [ | ]* - ::= "@" - ::= "$" -\end{verbatim}\end{footnotesize} %$ -\vskip-1pc -\caption{Textual syntax of variables} \label{VarTS} -\end{figure} - -\noindent -The syntax of query expressions (production \GP{query}) is described in -\figref{QueryTS}. - -\begin{figure}[ht] -\begin{footnotesize} \begin{verbatim} - ::= [ "inverse" ]? [ "sub" | "super" ]? -
::= [ "main" ]? - ::= [ "in" | "match" ] - ::= [ "istrue" [ "," ]* ]? - ::= [ "isfalse" [ "," ]* ]* - ::= [ "as" ]? - ::= [ "attr" [ "," ]* ]? - ::=
- ::= [ "pattern" ]? - ::= [ [ "," ]* ]? - ::= "(" ")" | | "[" "]" - | "property" "of" - | "let" "=" "in" - | ";;" | | - | "ex" | "." - | "add" [ "distr" ]? [ | ] "in" - | "for" "in" [ "sup" | "inf" ] - | "while" [ "sup" | "inf" ] - | "{" "}" "{" "}" - | "gen" [ "{" "}" | "in" ] - ::= [ [ "," ]* ]? - ::= "=" - ::= "{" [ ";" ]* "}" - ::= [ "," ]* - ::= [ "attr" ]? - ::= [ [ ";" ]* ]? -\end{verbatim} \end{footnotesize} -\vskip-1pc -\caption{Textual syntax of queries} \label{QueryTS} -\end{figure} - -\noindent -The syntax of result expressions (production \GP{avs}) is described in -\figref{ResultTS}. - -\begin{figure}[ht] -\begin{footnotesize} \begin{verbatim} - ::= "=" "{" [ [ "," ]* ]? "}" - ::= "{" [ ";" ]* "}" - ::= [ "attr" [ "," ]* ]? - ::= [ [ ";" ]* ]? -\end{verbatim} \end{footnotesize} -\vskip-1pc -\caption{Textual syntax of results} \label{ResultTS} -\end{figure} - -\xcomment { - -\begin{figure}[ht] -\begin{footnotesize} \begin{verbatim} - | "select" "from" "where" -\end{verbatim} \end{footnotesize} -\vskip-1pc -\caption{Textual syntax of basic query extensions} \label{BasicTS} -\end{figure} - -} +\input{mathql_introduction_avsets} +\input{mathql_introduction_property} +\input{mathql_introduction_core} +\input{mathql_introduction_basic} +\input{mathql_introduction_textual}