X-Git-Url: http://matita.cs.unibo.it/gitweb/?p=helm.git;a=blobdiff_plain;f=helm%2Fmathql%2Fdoc%2Fmathql_introduction_textual.tex;fp=helm%2Fmathql%2Fdoc%2Fmathql_introduction_textual.tex;h=0000000000000000000000000000000000000000;hp=2bcb2b4cd0a7592add7d94fccc0e5591ffa5331a;hb=1696761e4b8576e8ed81caa905fd108717019226;hpb=5325734bc2e4927ed7ec146e35a6f0f2b49f50c1 diff --git a/helm/mathql/doc/mathql_introduction_textual.tex b/helm/mathql/doc/mathql_introduction_textual.tex deleted file mode 100644 index 2bcb2b4cd..000000000 --- a/helm/mathql/doc/mathql_introduction_textual.tex +++ /dev/null @@ -1,178 +0,0 @@ -\subsection{Textual syntax} \label{Textual} - -In this section we present {\MathQL}.4 textual syntax using the same notation -that we adopted in \cite{GS03,Gui03}. In particular the grammatical -productions we use resemble {\BNF} with some {\POSIX} formalism: - -\begin{itemize} - -\item -\TT{::=} defines a grammatical production by means of a regular expression. - -Regular expressions are made of the following elements -(\TT{...} is a placeholder): - -\item -\TT{`...`} represents any character in a character set; - -\item -\verb+`^ ...`+ represents any character (U+20 to U+7E) 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} - -\begin{figure} -\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} - -\begin{figure} -\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} - -Queries and results 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.} -and the meaning of the escaped sequences is shown in \figref{EscTS} (where -$ .... $ is a 4-digit placeholder). -{\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 \emph{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. - -\begin{figure} -\begin{footnotesize} \begin{verbatim} - ::= [ 'A - Z' | 'a - z' | `_` ]+ - ::= [ | ]* - ::= "$" - ::= "@" -\end{verbatim}\end{footnotesize} %$ -\vskip-1pc -\caption{Textual syntax of variables} \label{VarTS} -\end{figure} - -Queries can also contain \emph{set} variables (production \GP{svar}) and -\emph{element} variables (production \GP{evar}) according to the syntax of -\figref{VarTS}.% -\footnote{This syntax resembles the one of programming languages identifiers.} -A set variable holds an {\av} set, {\ie} a query result, while an element -variable holds an {\av}. - -\begin{figure} -\begin{footnotesize} \begin{verbatim} - ::= [ "sub" | "super" ]? - ::= [ "inverse" ]? -
::= [ "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} - -\begin{figure} -\begin{footnotesize} \begin{verbatim} - ::= "=" | "{" [ "," ]* "}" - ::= "{" [ ";" ]* "}" - ::= [ "attr" [ "," ]* ]? - ::= [ [ ";" ]* ]? -\end{verbatim} \end{footnotesize} -\vskip-1pc -\caption{Textual syntax of results} \label{ResultTS} -\end{figure} - -\begin{figure} -\begin{footnotesize} \begin{verbatim} - ::= "empty" | "false" | "true" - | [ "not" | "count" | "proj" "of" ] - | [ "and" | "or" | "xor" ] - | [ "sub" | "meet" | "eq" | "le" | "lt" ] - | [ "union" | "intersect" | "diff" ] - | "{" "}" - | "keep" [ "allbut" ]? [ "in" ]? - | "if" "then" "else" - | "select" "from" "where" -\end{verbatim} \end{footnotesize} -\vskip-1pc -\caption{Textual syntax of the basic extension} \label{BasicTS} -\end{figure} - -The core infrastructure of {\MathQL}.4 defines a syntax for queries -(\figref{QueryTS}, production \GP{query}) and a syntax for results -(\figref{ResultTS}, production \GP{avs}). -A syntax extension for the most common functions of the basic library is -also provided for the user's convenience and for backward compatibility with -{\MathQL}.3. The syntax extension concerning the functions covered in this -paper is shown in \figref{BasicTS}. -Note that this extension makes \GP{avs} an instance of \GP{xavs}. - -