% file cas1.doc
% LateX file of CAS definition in BNF form.
%
\documentstyle[12pt]{article}
\makeatletter
% new dimens to get more stuff on a page in art11.sty
% (The old values are included at the end of the line in a comment, for
% comparison.)
% ****************************************
% * PAGE LAYOUT *
% ****************************************
%
% All margin dimensions measured from a point one inch from top and side
% of page.
% SIDE MARGINS:
\if@twoside % Values for two-sided printing:
\oddsidemargin 26pt % Left margin on odd-numbered pages. %36
\evensidemargin 64pt % Left margin on even-numbered pages. %74
\marginparwidth 90pt % Width of marginal notes. %100
\else % Values for one-sided printing:
\oddsidemargin 44pt % Note that \oddsidemargin = \evensidemargin
\evensidemargin 44pt %54
\marginparwidth 73pt %83
\fi
% VERTICAL SPACING:
% Top of page:
\topmargin -7pt % Nominal distance from top of page to top of
% box containing running head %27
\headheight 12pt % Height of box containing running head.
\headsep 25pt % Space between running head and text.
% \topskip = 10pt % '\baselineskip' for first line of page.
% Bottom of page:
\footskip 30pt % Distance from baseline of box containing foot
% to baseline of last line of text.
% DIMENSION OF TEXT:
% 24 Jun 86: changed to explicitly compute \textheight to avoid roundoff.
% The value of the multiplier was calculated as the floor of the
% old \textheight minus \topskip, divided by \baselineskip for \normalsize.
% The old value of \textheight was 530.4pt.
% \textheight is the height of text (including footnotes and figures,
% excluding running head and foot).
\textheight = 43\baselineskip %38
\advance\textheight by \topskip
\textwidth 380pt % Width of text line. %360
% For two-column mode:
\columnsep 10pt % Space between columns
\columnseprule 0pt % Width of rule between columns.
% my attempt to define a restricted tabular environment for BNF
% descriptions. Only two columns are allowed, \rightarrow is used
% between them, everything is aligned down the center, and the default
% type style is italic (so you have to explicitly use roman for
% terminals). Also defines \pipe and \term.
% Shamelessly stolen from the definition of tabular
\def\bnf{\def\@halignto{}\@bnf}
\def\endbnf{\crcr\egroup\egroup $\egroup}
\def\@bnf{\leavevmode \hbox \bgroup $\let\@acol\@tabacol
\let\@classz\@tabclassz
\let\@classiv\@tabclassiv
\let\\\cr
\def\arraystretch{1.5}
% make italic the default
\it
\@array[c]{r@{\ $\longrightarrow $\ }l}
% \@array[c]{r@{\ $\longrightarrow $\ }p{}}
}
% these are handy to have
\def\term#1{{\tt #1}}
\def\|{ $\mid$\ }
\newcommand{\code}[1]{{\tt #1}}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\pagestyle{empty}
The following BNF describes the syntax of the Common Answer
Specification for the ATIS domain:
\begin{center}
\begin{bnf}
answer & scalar-value \| relation \| \term{NO\_ANSWER} \\
boolean-value & \term{yes \| true \| no \| false} \\
number-value & integer \| real-number \\
relation & \term{(} tuple$^\star$ \term{)} \\
scalar-value & boolean-value \| number-value \| string \\
tuple & \term{(} value$^+$ \term{)} \\
value & scalar-value \| \term{NIL} \\
\end{bnf}
\end{center}
We assume as primitives the values {\it integer}, {\it real-number},
and {\it string}. Integers and reals are not distinguished, and only
non-exponential real numbers are allowed. Strings must always be
enclosed in double quotes (i.e., \term{"DFW"}), are case-sensitive,
and should be upper-case (since strings in the ATIS database are).
The special tokens \term{yes}, \term{no}, \term{true},
\term{false}, \term{no_answer} and \term{nil} are not case-sensitive.
Answer relations must be derived from the existing relations in the
database, either by subsetting and combining relations or by
operations like averaging, summation, etc. NIL as the representation
of missing data is allowed as a special case for any value, so a legal
answer indicating the costs of ground transportation in Boston would be
\begin{quote}
\term{(("L" 5.00 ) ("R" nil ) ("A" nil ) ("R" nil ))}
\end{quote}
Empty tuples are not allowed (but empty relations are). All the
tuples in a relation must have the same number of values, those values
must be of the same respective types (boolean, string, or number), and
the types in the answer must be the same as the types in the database
(i.e., database values like \term{"1355"} cannot be converted from strings
to numbers in answer expressions).
\end{document}