\batchmode
%This Latex file is machine-generated by the BNF-converter
\documentclass[a4paper,11pt]{article}
\author{BNF-converter}
\title{The Language HOL}
\setlength{\parindent}{0mm}
\setlength{\parskip}{1mm}
\begin{document}
\maketitle
\newcommand{\emptyP}{\mbox{$\epsilon$}}
\newcommand{\terminal}[1]{\mbox{{\texttt {#1}}}}
\newcommand{\nonterminal}[1]{\mbox{$\langle \mbox{{\sl #1 }} \! \rangle$}}
\newcommand{\arrow}{\mbox{::=}}
\newcommand{\delimit}{\mbox{$|$}}
\newcommand{\reserved}[1]{\mbox{{\texttt {#1}}}}
\newcommand{\literal}[1]{\mbox{{\texttt {#1}}}}
\newcommand{\symb}[1]{\mbox{{\texttt {#1}}}}
This document was automatically generated by the {\em BNF-Converter}. It was generated together with the lexer, the parser, and the abstract syntax module, which guarantees that the document matches with the implementation of the language (provided no hand-hacking has taken place).
\section*{The lexical structure of HOL}
\subsection*{Literals}
Idents literals are recognized by the regular expression
\({\nonterminal{letter}}+ {\nonterminal{digit}}* \mid {\nonterminal{digit}}+\)
PredId literals are recognized by the regular expression
\({\nonterminal{upper}} {\nonterminal{letter}}* \mbox{`('}\)
FunctId literals are recognized by the regular expression
\({\nonterminal{lower}} {\nonterminal{letter}}* \mbox{`('}\)
\subsection*{Reserved words and symbols}
The set of reserved words is the set of terminals appearing in the grammar. Those reserved words that consist of non-letter characters are called symbols, and they are treated in a different way from those that are similar to identifiers. The lexer follows rules familiar from languages like Haskell, C, and Java, including longest match and spacing conventions.
The reserved words used in HOL are the following: \\
\begin{tabular}{lll}
{\reserved{and}} &{\reserved{else}} &{\reserved{exists}} \\
{\reserved{false}} &{\reserved{forall}} &{\reserved{if}} \\
{\reserved{implies}} &{\reserved{in}} &{\reserved{let}} \\
{\reserved{not}} &{\reserved{or}} &{\reserved{then}} \\
{\reserved{true}} & & \\
\end{tabular}\\
The symbols used in HOL are the following: \\
\begin{tabular}{lll}
{\symb{)}} &{\symb{{$=$}}} &{\symb{.}} \\
{\symb{)(}} &{\symb{,}} &{\symb{;}} \\
{\symb{(}} & & \\
\end{tabular}\\
\subsection*{Comments}
Single-line comments begin with {\symb{{$-$}{$-$}}}. \\There are no multiple-line comments in the grammar.
\section*{The syntactic structure of HOL}
Non-terminals are enclosed between $\langle$ and $\rangle$.
The symbols {\arrow} (production), {\delimit} (union)
and {\emptyP} (empty rule) belong to the BNF notation.
All other symbols are terminals.\\
\begin{tabular}{lll}
{\nonterminal{PROGRAM}} & {\arrow} &{\nonterminal{ListSENT}} \\
\end{tabular}\\
\begin{tabular}{lll}
{\nonterminal{SENT6}} & {\arrow} &{\nonterminal{PredId}} {\nonterminal{ListTERMS}} {\terminal{)}} \\
& {\delimit} &{\terminal{true}} \\
& {\delimit} &{\terminal{false}} \\
& {\delimit} &{\nonterminal{Idents}} \\
& {\delimit} &{\nonterminal{TERM}} {\terminal{{$=$}}} {\nonterminal{TERM}} \\
& {\delimit} &{\terminal{(}} {\nonterminal{SENT}} {\terminal{)}} \\
\end{tabular}\\
\begin{tabular}{lll}
{\nonterminal{SENT5}} & {\arrow} &{\terminal{not}} {\nonterminal{SENT5}} \\
& {\delimit} &{\nonterminal{SENT6}} \\
\end{tabular}\\
\begin{tabular}{lll}
{\nonterminal{SENT4}} & {\arrow} &{\terminal{if}} {\nonterminal{SENT3}} {\terminal{then}} {\nonterminal{SENT3}} {\terminal{else}} {\nonterminal{SENT3}} \\
& {\delimit} &{\terminal{let}} {\nonterminal{ListDEF}} {\terminal{in}} {\nonterminal{SENT2}} \\
& {\delimit} &{\nonterminal{SENT5}} \\
\end{tabular}\\
\begin{tabular}{lll}
{\nonterminal{SENT3}} & {\arrow} &{\nonterminal{SENT3}} {\terminal{and}} {\nonterminal{SENT4}} \\
& {\delimit} &{\nonterminal{SENT3}} {\terminal{or}} {\nonterminal{SENT4}} \\
& {\delimit} &{\nonterminal{SENT4}} \\
\end{tabular}\\
\begin{tabular}{lll}
{\nonterminal{SENT2}} & {\arrow} &{\nonterminal{SENT2}} {\terminal{implies}} {\nonterminal{SENT3}} \\
& {\delimit} &{\nonterminal{SENT3}} \\
\end{tabular}\\
\begin{tabular}{lll}
{\nonterminal{DEF}} & {\arrow} &{\nonterminal{Idents}} {\terminal{{$=$}}} {\nonterminal{SENT}} \\
\end{tabular}\\
\begin{tabular}{lll}
{\nonterminal{SENT}} & {\arrow} &{\terminal{forall}} {\nonterminal{ListTERM}} {\terminal{.}} {\nonterminal{SENT}} \\
& {\delimit} &{\terminal{exists}} {\nonterminal{ListTERM}} {\terminal{.}} {\nonterminal{SENT}} \\
& {\delimit} &{\nonterminal{SENT1}} \\
\end{tabular}\\
\begin{tabular}{lll}
{\nonterminal{TERM}} & {\arrow} &{\nonterminal{FunctId}} {\nonterminal{ListTERMS}} {\terminal{)}} \\
& {\delimit} &{\nonterminal{TERM1}} \\
\end{tabular}\\
\begin{tabular}{lll}
{\nonterminal{TERM1}} & {\arrow} &{\nonterminal{Idents}} \\
& {\delimit} &{\terminal{(}} {\nonterminal{TERM}} {\terminal{)}} \\
\end{tabular}\\
\begin{tabular}{lll}
{\nonterminal{TERMS}} & {\arrow} &{\nonterminal{ListTERM}} \\
\end{tabular}\\
\begin{tabular}{lll}
{\nonterminal{ListTERMS}} & {\arrow} &{\emptyP} \\
& {\delimit} &{\nonterminal{TERMS}} \\
& {\delimit} &{\nonterminal{TERMS}} {\terminal{)(}} {\nonterminal{ListTERMS}} \\
\end{tabular}\\
\begin{tabular}{lll}
{\nonterminal{ListDEF}} & {\arrow} &{\emptyP} \\
& {\delimit} &{\nonterminal{DEF}} \\
& {\delimit} &{\nonterminal{DEF}} {\terminal{,}} {\nonterminal{ListDEF}} \\
\end{tabular}\\
\begin{tabular}{lll}
{\nonterminal{ListSENT}} & {\arrow} &{\emptyP} \\
& {\delimit} &{\nonterminal{SENT}} {\terminal{;}} {\nonterminal{ListSENT}} \\
\end{tabular}\\
\begin{tabular}{lll}
{\nonterminal{SENT1}} & {\arrow} &{\nonterminal{SENT2}} \\
\end{tabular}\\
\begin{tabular}{lll}
{\nonterminal{ListTERM}} & {\arrow} &{\emptyP} \\
& {\delimit} &{\nonterminal{TERM}} \\
& {\delimit} &{\nonterminal{TERM}} {\terminal{,}} {\nonterminal{ListTERM}} \\
\end{tabular}\\
\end{document}