Attention: Maintenance on monday 19.04.2021 from 07:00 - 13:00 (Gitlab and Mattermost are offline!)

Commit a88ca0b5 authored by Michael Kohlhase's avatar Michael Kohlhase

tweaks

parent b577b4f7
......@@ -137,8 +137,8 @@ Our goal is to have a grammar that is as semantic as possible, while still
being able to use \GF's resource grammar.
Our current example looks like this:
\lstinputlisting[language=GF]{oneWordExample.gf}
\lstinputlisting[language=GF]{oneWordExampleEN.gf}
\lstinputlisting[language=GF,firstline=5]{oneWordExample.gf}
\lstinputlisting[language=GF,firstline=3]{oneWordExampleEN.gf}
\section{Case Study: Definition of Prime Numbers}
To understand the problem better, we consider the following example sentence:
......@@ -161,10 +161,10 @@ do that. They add \lstinline|MathLex.gf| and \lstinline|MathLexEng.gf| in
Figure~\ref{fig:mathlex} to the grammars \lstinline|Lang.gf|/\lstinline|LangEng.gf| from
the GF distribution.
\begin{figure}[ht]\centering
\begin{tabular}{|p{5cm}|p{8cm}|}\hline
\begin{figure}[ht]\centering\small
\begin{tabular}{|p{5cm}|p{9.5cm}|}\hline
\lstinputlisting[language=GF]{MathLex.gf} &
\lstinputlisting[language=GF]{MathLexEng.gf}\\\hline
\lstinputlisting[language=GF,firstline=3]{MathLexEng.gf}\\\hline
\end{tabular}
\caption{Mathematical Lexicon}\label{fig:mathlex}
\end{figure}
......@@ -182,40 +182,41 @@ Here are some limitations and problems: What to do about
The \GF already has the math grammars from the WebAlt and Molto projects~\cite{MOLTO:on},
they can be found at~\cite{molto-gf:on}. The work is described
in~\cite{SalXam:tgml12,CaprottiSaludes:OpenMathUIWiP2012,ArcCapRanSal:ugmam12}
in~\cite{SalXam:tgml12,CaprottiSaludes:OpenMathUIWiP2012,ArcCapRanSal:ugmam12,MOLTO:D6.1}
\subsection{Understanding the MGL structure}
Let's take a closer look at the MGL (Mathematics Grammar Library) structure.
In the \texttt{abstract} directory, the semantic grammars are defined. In \texttt{resources},
these concepts are mapped to the corresponding syntactic representations.
These are for most languages similar, so \gfinline{incomplete concrete} grammars are used that
are not language-specific.
In the language directories, a lexicon is defined with all the words. Also, concrete grammars for
each concept are defined. These files bring all dependencies together and treat language-specific
special cases (when the semantic-to-syntactic mapping differs).
Let's take a closer look at the MGL (Mathematics Grammar Library) structure. In the
\texttt{abstract} directory, the semantic grammars are defined. In \texttt{resources},
these concepts are mapped to the corresponding syntactic representations. These are for
most languages similar, so a GF functor is used (indicated by the keyword
\gfinline{incomplete}) are used that are not language-specific. In the language
directories, a lexicon is defined with all the words. Also, concrete grammars for each
concept are defined. These files bring all dependencies together and treat
language-specific special cases (when the semantic-to-syntactic mapping differs).
\subsubsection{Example \gfinline{root}}
The \gfinline{root} function is declared in \texttt{abstract/Arith1.gf} as
\begin{lstlisting}[language=GF]
root : ValNum -> Index -> ValNum;
\end{lstlisting}
In \texttt{resources/Arith1I}, which is an \gfinline{incomplete concrete}
grammar for \gfinline{Arith1}, \gfinline{root} gets linearized in the following way:
In \texttt{resources/Arith1I}, which is a functor for \gfinline{Arith1}, \gfinline{root}
gets linearized in the following way:
\begin{lstlisting}[language=GF]
root = DefGenCNidx root_CN ;
root = DefGenCNidx root_CN ;
\end{lstlisting}
\gfinline{DefGenCNidx} is defined in \texttt{resources/Math.gf} as
\begin{lstlisting}[language=GF]
DefGenCNidx : CN -> MathObj -> MathIdx -> MathObj ;
DefGenCNidx : CN -> MathObj -> MathIdx -> MathObj ;
\end{lstlisting}
and in \texttt{resources/MathI.gf} it is defined it as
\begin{lstlisting}[language=GF]
DefGenCNidx = \cn,obj,i ->
mkNP (mkDet the_Quant (mkOrd i))
(modCN cn (mkAdv my_possess_Prep obj)) ;
DefGenCNidx = \cn,obj,i ->
mkNP (mkDet the_Quant (mkOrd i))
(modCN cn (mkAdv my_possess_Prep obj)) ;
\end{lstlisting}
Everything is brought together in \texttt{english/Arith1Eng.gf}.
The word \gfinline{root_CN} is defined in \texttt{english/LexiconEng.gf}.
Everything is brought together in \texttt{english/Arith1Eng.gf}. The word
\gfinline{root_CN} is defined in \texttt{english/LexiconEng.gf}.\ednote{MK: Make an
example phrase with \nlex{root} in it and show what the abstract grammar term is.}
\section{Conclusion}\label{sec:concl}
\ednote{tbw.}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment