A generation algorithm for f-structure representations
Extracted source text ยท arXiv cmp-lg/9709005
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%% Per la RANLP-97. A veure si l'accepten !! %%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentstyle[tree-dvips,mlap,ranlp97]{article}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% MACROS BY ESTHER KOENIG !!! %%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Latex command files
%\input{/home/users0/esther/latex/forms/general}
% 94-03-28 Esther Koenig, IMS, Uni Stuttgart
%
% Latex-macros - general stuff
%%
%% equation-environment for text
%%
%% width of text-example
\newlength{\texteqlength}%
\setlength{\texteqlength}{\textwidth}%
\addtolength{\texteqlength}{-3em}%
%% environment : tequation
\newenvironment{tequation}%
{\begin{equation}%
\begin{minipage}[c]{\texteqlength}\begin{center}}%
{\end{center}\end{minipage}\end{equation}}%
%\input{/home/users0/esther/latex/forms/cuf}
% 94-04-11 Esther Koenig, IMS, Uni Stuttgart
%%
%% Latex-macros for feature structures and nicely displayed CUF-code
%%
\newenvironment{code}{\begin{tt}}{\end{tt}}
%%
%% `fs' - environment for feature structures
%% (a specialized 'tabular'-environment)
\newenvironment{fs}%
{$\left[\hspace{.5ex}\begin{tabular}{l@{\hspace{1ex}:\hspace{1ex}}l}}%
{\end{tabular}\hspace{.3ex}\right]$}%
%% code indentation
\newlength{\cufindent}
\setlength{\cufindent}{3ex}
\newcommand{\codevspace}{\par\vspace*{0.3em}\noindent}%
%%
%% non-trivial CUF-terms (feature structures)
%%
\newenvironment{cuf}%
{$\left(\hspace{-0.1em}\begin{tabular}{l@{\hspace{1ex}:\hspace{1ex}}l}}%
{\end{tabular}\hspace{-0.1em}\right)$}%
%% something which isn't a feature-value pair
\newcommand{\cufoneline}[1]{\multicolumn{2}{l}{#1}}
%%
%% CUF-lists
%%
%% cuflist [ anything ]
\newenvironment{cuflist}%
{\begin{math}\left[\begin{tabular}{l}}%
{\end{tabular}\right]\end{math}}%
\newcommand{\emptycuflist}{\begin{cuflist}$\!\!\!\!$\end{cuflist}}
%% cuflistcons: [ head | tail ]
\newcommand{\cuflistcons}[2]
{\begin{math}
\left[\begin{tabular}{c}
\begin{math}\left.\begin{tabular}{c}
\hspace*{-1em}#1
\end{tabular}\right|\end{math} #2%
\end{tabular}\right]
\end{math}}
%%
%% CUF-sort calls and definitions
%%
%% cufsort #1 sort-symbol #2 list of arguments
\newcommand{\cufsort}[2]{#1$\left(\begin{tabular}{c}#2\end{tabular}\right)$}
%% cufclause #1 head #2 body
\newcommand{\cufclause}[2]%
{#1 := \\%
\hspace*{\cufindent}#2.}%
%% short cufclause - #1 head #2 body - without line break between head and body
\newcommand{\shortcufclause}[2]{#1 := #2.}%
%%
%% CUF-types
%%
%% cuftypedecl #1 head #2 body
\newcommand{\cuftypedecl}[2]{#1 -> #2.}%
%% feature declaration (appropriateness constraint)
%% #1 type name #2 list of feature value pairs
\newcommand{\cuffeatdecl}[2]
{\begin{tabular}{l}#1 ::\\ \hspace{\cufindent}\begin{feats}#2\end{feats}\end{tabular}}%
%% feature declaration (appropriateness constraint)
%% #1 type name #2 list of feature value pairs (using feats-environment)
%% in semi-graphical notation
\newcommand{\featdecl}[2]
% {\begin{tabular}[t]{c}
{\begin{tabular}{c}
#1 \\
\fbox{\begin{feats}#2\end{feats}}
\end{tabular}}
%% feats - list of features to be declared for a type
\newenvironment{feats}{\begin{tabular}{l@{\hspace{1ex}:\hspace{1ex}}l}}%
{\end{tabular}}%
%% enumeration type
\newcommand{\cufenumtype}[2]{#1 = \{ #2 \}}
%% subsort declaration
\newcommand{\cufsubsort}[2]{#1 < #2}
%\input{/home/users0/esther/latex/forms/strees}
% 93-12-22 Esther Koenig, IMS, Uni Stuttgart
%
% Latex-macros for graphical representation of trees (using Emma Pease tree-dvips)
% (syntax tree version)
%%%%%%%%%%%%%%%%%%%%%%%%
%% general node manipulation
%% names for nodes
\newcounter{maxnode}
\setcounter{maxnode}{500}
% local node names
\newcounter{nodea}
\setcounter{nodea}{1}
\newcounter{nodeb}
\setcounter{nodeb}{2}
\newcounter{nodec}
\setcounter{nodec}{3}
\newcounter{noded}
\setcounter{noded}{4}
\newcounter{nodee}
\setcounter{nodee}{5}
\newcounter{nodef}
\setcounter{nodef}{6}
\newcounter{nodeg}
\setcounter{nodeg}{7}
\newcounter{nodeh}
\setcounter{nodeh}{8}
\newcounter{nodei}
\setcounter{nodei}{9}
\newcounter{nodej}
\setcounter{nodej}{10}
\newcounter{numberofnodes} % max number of local nodes
\setcounter{numberofnodes}{10}
%% increases all available node counters
\newcommand{\newnodenames}{
\addtocounter{nodea}{\thenumberofnodes}
\addtocounter{nodeb}{\thenumberofnodes}
\addtocounter{nodec}{\thenumberofnodes}
\addtocounter{noded}{\thenumberofnodes}
\addtocounter{nodee}{\thenumberofnodes}
\addtocounter{nodef}{\thenumberofnodes}
\addtocounter{nodeg}{\thenumberofnodes}
\addtocounter{nodeh}{\thenumberofnodes}
\addtocounter{nodei}{\thenumberofnodes}
}
%% reset all available node counters to previous values
\newcommand{\oldnodenames}{
\addtocounter{nodea}{-\thenumberofnodes}
\addtocounter{nodeb}{-\thenumberofnodes}
\addtocounter{nodec}{-\thenumberofnodes}
\addtocounter{noded}{-\thenumberofnodes}
\addtocounter{nodee}{-\thenumberofnodes}
\addtocounter{nodef}{-\thenumberofnodes}
\addtocounter{nodeg}{-\thenumberofnodes}
\addtocounter{nodeh}{-\thenumberofnodes}
\addtocounter{nodei}{-\thenumberofnodes}
}
%%%%%%%%%%%%%%%%%%
%% natural deduction derivations
% binary branch in a (syntax) tree
% #2 #3
%
% #1
\newcommand{\binatree}[3]{
\newnodenames
\begin{array}{cc}
\multicolumn{2}{c}{
\node
{\thenodea}
{$#1$}}
\\
\\
\node
{\thenodeb}
{$ #2
$}
&
\node
{\thenodec}
{$
\addtocounter{nodea}{\themaxnode}
\addtocounter{nodeb}{\themaxnode}
\addtocounter{nodec}{\themaxnode}
#3
\addtocounter{nodea}{-\themaxnode}
\addtocounter{nodeb}{-\themaxnode}
\addtocounter{nodec}{-\themaxnode}
$}
\end{array}
\nodeconnect[b]{\thenodea}[t]{\thenodeb}
\nodeconnect[b]{\thenodea}[t]{\thenodec}
\oldnodenames }
% 'lexical' unary branch in a tree
% #1
% #2
%
\newcommand{\lunatree}[2]{
\begin{array}{c}
#1
\\
|
\\
\mbox{{\tt #2}}
\end{array}
}
% unary branch in a tree
% #1
% |
% #2
%
\newcommand{\unatree}[2]{
\begin{array}{c}
#1
\\
|
\\
#2
\end{array}
}
% triangle
% #1
% / \
% ----
% #2
\newcommand{\verticalspace}{$\begin{array}{c}\\\end{array}\hspace*{-1em}$}
\newcommand{\vdtree}[2]{%
\newnodenames%
\begin{array}{c}
\node
{\thenodea}
{$#1$}
\\
\\
\node
{\thenodeb}
{\makebox[1em]{\verticalspace}}
\node
{\thenodec}
{$#2$\verticalspace}
\node
{\thenoded}
{\makebox[1em]{\verticalspace}}
\end{array}%
\nodeconnect[b]{\thenodea}[l]{\thenodeb}%
\nodeconnect[b]{\thenodea}[r]{\thenoded}%
\nodeconnect[l]{\thenodeb}[l]{\thenodec}%
\nodeconnect[r]{\thenodec}[r]{\thenoded}%
\oldnodenames%
}%
% triangle with dotted lines
% #1
% / \
% ----
% #2
\newcommand{\vddottree}[2]{%
\newnodenames%
\begin{array}{c}
\node
{\thenodea}
{$#1$}
\\
\\
\node
{\thenodeb}
{\makebox[1em]{\verticalspace}}
\node
{\thenodec}
{$#2$\verticalspace}
\node
{\thenoded}
{\makebox[1em]{\verticalspace}}
\end{array}%
\makedash{3pt}%
\nodeconnect[b]{\thenodea}[l]{\thenodeb}%
\nodeconnect[b]{\thenodea}[r]{\thenoded}%
\nodeconnect[l]{\thenodeb}[l]{\thenodec}%
\nodeconnect[r]{\thenodec}[r]{\thenoded}%
\oldnodenames%
}%
% triangle with leaves only
% .
% / \
% ----
% #1
\newcommand{\vddtree}[1]{%
\newnodenames%
\begin{array}{c}
\node
{\thenodea}
{}
\\
\\
\node
{\thenodeb}
{\makebox[1em]{\verticalspace}}
\node
{\thenodec}
{$#1$\verticalspace}
\node
{\thenoded}
{\makebox[1em]{\verticalspace}}%
\end{array}%
\nodeconnect[t]{\thenodea}[l]{\thenodeb}%
\nodeconnect[t]{\thenodea}[r]{\thenoded}%
\nodeconnect[l]{\thenodeb}[l]{\thenodec}%
\nodeconnect[r]{\thenodec}[r]{\thenoded}%
\oldnodenames%
}
% triangle with root only
% #1
% / \
% ----
%
\newcommand{\vdrtree}[1]{%
\newnodenames%
\begin{array}{c}
\node
{\thenodea}
{$#1$}
\\
\\
\node
{\thenodeb}
{\makebox[2.5em]{{}\verticalspace}}
\end{array}%
\nodeconnect[b]{\thenodea}[l]{\thenodeb}%
\nodeconnect[b]{\thenodea}[r]{\thenodeb}%
\nodeconnect[l]{\thenodeb}[r]{\thenodeb}%
\oldnodenames%
}
%\input{/home/users0/esther/latex/forms/drs}
% 93-12-20 Esther Koenig, IMS, Uni Stuttgart
%%
%% Latex-macros for (U)DRSs
%% - requires the use of Emma Pease's 'tree-dvips' and of 'strees.tex'
%%
%% drs-macros
%%
%% drs : ---
%% |#1| #1 discourse referents and conditions
%% ---
\newcommand{\drs}[1]{\begin{array}{|l|} \hline #1 \\ \hline \end{array}}%
%% types of conditions
%% discourse referent #1
\newcommand{\dref}[1]{#1}
%% concept name
\newcommand{\concept}[1]{\mbox{{\tt #1}}}
%% simple condition: #1 predicate name #2 arguments
\newcommand{\rel}[2]{\concept{#1}(#2)}
%% generalized quantifier #1 quantifier #2 variable #3 Restrictor #4 Scope
\newcommand{\gquant}[4]{\drs{#3}\rhomb{#1}{#2}\drs{#4}}
%%
%% underspecified DRSs
%%
%% \udrsdiamond #1
%% #2 #3
%% #4
%% the nodes topscope, scopeleft and scoperight have to be defined inside of #2 and #3 resp.
\newcommand{\udrsdiamond}[4]{%
\begin{array}{ccc}
& #1 &
\\
\\
\node{leftq}{\begin{math}#2\end{math}} & & \node{rightq}{\begin{math}#3\end{math}}
\\
\\
& \node{bottomq}{\begin{math}#4\end{math}} &
\end{array}%
\anodeconnect[t]{leftq}[b]{topscope}%
\anodeconnect[t]{rightq}[b]{topscope}%
\anodeconnect[t]{bottomq}[b]{scopeleft}%
\anodeconnect[t]{bottomq}[b]{scoperight}}%
%% auxiliary stuff
\newcommand{\drsvspace}{\begin{tabular}{c}\mbox{}\\\mbox{}\\ \end{tabular}\hspace*{-1em}}
%% \rhomb #1 quantifier #2 variable
\newcommand{\rhomb}[2]{%
\begin{array}{ccc}%
&\node{rhombt}{}&\\%
\node{rhombl}{\drsvspace}&\begin{array}{c}#1\\#2\end{array}&\node{rhombr}{\drsvspace}\\%
&\node{rhombb}{}&%
\end{array}%
\nodeconnect[t]{rhombt}[l]{rhombl}%
\nodeconnect[t]{rhombt}[r]{rhombr}%
\nodeconnect[l]{rhombl}[t]{rhombb}%
\nodeconnect[r]{rhombr}[t]{rhombb}}%
%\input{cggcom}
%% Latex commands
%%
%% reference to a figure #1 label name
\newcommand{\figref}[1]{Fig.\ref{#1}}
%% natural language examples
\newcommand{\natl}[1]{{\tt `#1'}}
%% for short stuff
\newcommand{\pcode}[1]{\begin{tt}#1\end{tt}}
%% indentation
\newlength{\codeindent} \setlength{\codeindent}{3ex}
% a category with a to-bind:slash feature #1 category #2 slash value
\newcommand{\slashed}[2]{{#1}_{\mbox{\pcode{/#2}}}}
% a category with a inherited:slash feature #1 category #2 slash value
\newcommand{\dslashed}[2]{{#1}_{\mbox{\pcode{/$\!\!$/$#2$}}}}
\newcommand{\linkrel}[2] {\begin{array}{c} \node{a}{$#1$} \\ \\
\node{b}{$#2$}
\end{array}
\makedash{1pt} \nodeconnect{a}{b} \makedash{0pt}}
% aus eqprcom.tex
%
%\newtheorem{corollary}{Corollary}
\newtheorem{definition}{Definition}
\newtheorem{example}{Example}
%\newtheorem{lemma}{Lemma}
%\newtheorem{proposition}{Proposition}
%\newtheorem{sublemma}{Sublemma}
%\newtheorem{theorem}{Theorem}
%% Proof - not as single environment, one proof might be partitioned into two files
%% marks the beginning of a proof
%\newcommand{\bop}[1]{\noindent {\em #1:} \hspace{0.3em}}
%\newcommand{\boproof}{\bop{Proof}}
%% marks the end of a proof
%\newcommand{\eoproof}{$\Box$}
%% tree pair: a syntax tree and a semantic derivation tree
\newcommand{\treepair}[2]{\left\langle\!#1#2\!\right\rangle}
%% syntax-semantic pair (node label)
\newcommand{\npair}[2]{\left\langle #1,#2 \right\rangle}
\newcommand{\stackedtrees}[2]{\!\!\begin{array}{c}#1\\[-0.8em]#2\end{array}\!\!}
%% Gentzen-style derivations
%% axiom leaf in a proof derivation
%%
%% ------------- 2#rulename
%% #1conclusion
\newcommand{\nullrule}[2]{
\begin{array}{cc}
&
#2
\\[-0.7em] \cline{1-1}
#1
\end{array}
}
%% unary branch in a derivation tree
%%
%% #2premise
%% ------------- 3#rulename
%% #1conclusion
\newcommand{\unarule}[3]{
\begin{array}{cc}
#2
\\[-0.7em]
&
#3
\\[-0.7em] \cline{1-1}
#1
\end{array}
}
%% binary branch in a derivation tree
%%
%% #2premise #3premise
%% ---------------------- 4#rulename
%% #1conclusion
\newcommand{\binarule}[4]{
\begin{array}{ccc}
#2 \;\; & \;\; #3
\\[-0.7em]
& & #4
\\[-0.7em] \cline{1-2}
\multicolumn{2}{c}{#1}
\end{array}
}
%% font for functions
%\newcommand{\func}[1]{{\tt #1\/}}
%% - grammar definition -
%% variables for grammar
%\newcommand{\gram}{G}
%% variables for set of categories
%\newcommand{\catset}{C}
%\newcommand{\catseti}[1]{\catset_{#1}} % #1 : subscript
%% variables for strings
%\newcommand{\strng}{\alpha}
%% variables for set of terminal symbols
%\newcommand{\lexset}{{\cal T}}
%% variables for lexemes, terminal symbols:
\newcommand{\lexemi}[1]{w_{#1}}
%% variables for lexicon, lexical mapping
%\newcommand{\lexic}{L}
%% variables for grammar
\newcommand{\grami}[1]{G_{#1}}
%% material for calculus definition
%% infrule{ LHS }{ RHS }{RuleName}
\newcommand{\infrule}[3]
{#1 \;\;\stackrel{\rname{#3}}{\Longrightarrow} \;\; #2}
%% format of a rule name
\newcommand{\rname}[1]{\mbox{{\it (#1)\/}}}
%% grule{ LHS }{ RHS } - grammar rule
\newcommand{\grule}[2]
{#1 \longrightarrow #2}
%% binfrule{ LHS }{ RHS } twoside arrow
%\newcommand{\binfrule}[2]
% {#1 \;\;\Longleftrightarrow \;\; #2}
%% infarrow - for manually, vertical print of inference rules
%\newcommand{\infarrow}{\begin{center}$\Downarrow$\end{center}}
%% sequent{ LHS }{ RHS }
\newcommand{\sequent}[2]{#1 \rightarrow #2}
%% a special sequent for the generation calculus
\newcommand{\genseq}[7]{\sequent{#1, \; #2, \; #3, \; #4, \; #5}{#6, \; #7}}
%% - variables for categories -
%% variables for goal category
%\newcommand{\gcateg}{g}
%% variables for categories
\newcommand{\categ}{x}
\newcommand{\categb}{y}
\newcommand{\categc}{z}
\newcommand{\categi}[1]{x_{#1}} % #1 : subscript
%% variables for semantic representations
\newcommand{\semi}[1]{X_{#1}} % #1 : subscript
% - shape of categories -
%% #1: value #2: argument
%% leftward functor: #2 \ #1
%% rightward functor: #1 / #2
%% neutral direction: #1 | #2
%% product: #1 * #2
\newcommand{\lc}[2]{#2 \backslash #1} % Lambek notation
%\newcommand{\lc}[2]{#1 \backslash #2} % Steedman notation
%\newcommand{\cuflc}[2]{\mbox{{\tt leaves([lleaf(#2)$|$#1])}}} % CUF notation
%\newcommand{\acuflc}[2]{\mbox{{\em leaves([lleaf(#2)$|$#1])}}} % CUF notation
\newcommand{\rc}[2]{#1 / #2}
%\newcommand{\cufrc}[2]{\mbox{{\tt leaves([rleaf(#2)$|$#1])}}} % CUF notation
%\newcommand{\acufrc}[2]{\mbox{{\em leaves([rleaf(#2)$|$#1])}}} % CUF notation
%\newcommand{\bc}[2]{#1 | #2}
%\newcommand{\acufbc}[2]{\mbox{{\tt root(#1) \& leaves(#2) }}} % CUF notation
%\newcommand{\bci}[3]{#1 \, |_{#3} \, #2} % slash with identifier
%\newcommand{\ac}[2]{#1 \ast #2}
%% array of argument categories
%\newcommand{\argcats}[1]{{\stackrel{\leftrightarrow}{\categ}}_{#1}}
%\newcommand{\largcats}[1]{{\stackrel{\leftarrow}{\categ}}_{#1}}
%\newcommand{\rargcats}[1]{{\stackrel{\rightarrow}{\categ}}_{#1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% END OF MACROS BY ESTHER KOENIG !!! %%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{A generation algorithm for f-structure representations}
\author{ Toni Tuells \\
IULA , Universitat Pompeu Fabra
\\ La Rambla 30-32\\
Barcelona 08028, Catalonia (Spain) \\
{\tt tuells@upf.es}}
\begin{document}
%\subject{tactical generation}
\bibliographystyle{ranlp,fullname}
\maketitle
\thispagestyle{empty}
%\footnotesize
\begin{abstract}
This paper shows that previously reported generation algorithms run into problems when dealing with f-structure representations. A generation algorithm that is suitable for this type of representations is presented: the Semantic Kernel Generation (SKG) algorithm. The SKG method has the same processing strategy as the Semantic Head Driven generation (SHDG) algorithm and relies on the assumption that it is possible to compute the Semantic Kernel (SK) and non Semantic Kernel (Non-SK) information for each input structure. \\
%%{\bf Keywords}: tactical generation, reversibility, unification grammars
\end{abstract}
%\normalsize
%\pagestyle{empty}
\section{Introduction}
%%Ideally, a declarative grammar should be suitable for both parsing and generation.
%%Unfortunately, things are not that easy. As it is well-known, for many
%%declarative grammars the implicit concept of derivation is
%%that of parsing. As a result, parsing is easier than generation; given a
%%grammar formalism,
%%there are several well-known parsing strategies that one could (more
%%or less easily) adapt. The same does not hold for (tactical) generation,
%%since the task of generating a string out of a semantic representation
%%becomes more complex due to the fact that semantic representations vary
%%according to the theories adopted. Not surprisingly, different generation
%%algorithms are defined for each type of semantic representation.
In this paper we take up the problem of (tacticaly) generating a string
from an f-structure representation; we will show that generation algorithms that have already been described in the literature are not directly applicable to this type of representations,
and we will propose a new generation algorithm:
the Semantic Kernel Generation (SKG) algorithm. We will also show that since the SKG generator is guided by the {\em semantic-head} and {\em syntactic-head} relations, it can be seen both as a variant of the {\em semantic head driven generation algorithm}) (SHDG) \cite{Shieb:90} and the {\em syntactic-head driven generation algorithm} (SynHDG) \cite{Koenig:syn}.
A former version of this work was originally reported in \cite{Nicpers:96}, which also describes alternative generation algorithms for f-structure representations.
\section{The Semantic Kernel Generation Algorithm}
%% Presentacio. Figures (gramatica i representacio f)
%% Problema 1: Aplicacio directa del SHDG
%% Problema 2: Aplicacio del Map
%% Solucio: SK algoritme
%% a) idea intuitiva
%% b) formalitzacio de l'algoritme
%% c) exemple
%% d) requeriments. Valoracio
%%\subsection{Problems with former approaches}
%%\subsection{Our Proposal}
%% \subsection{An Example}
In order to show why former generators fail to generate from f-structures and why SKG works, we will assume the grammar fragment and lexical entries (originally described in \cite{Nicpers:96}) which are shown in Figures~\ref{Lexical entry},~\ref{grammar fragment}.\footnote{ For the grammar fragment only the relevant semantic information is shown.}
As for the grammar fragment, note that {\em rules 1a and 1b} introduce modifiers at sentence level, and {\em rule 3} introduces modifiers at vp level.{\em Rule 2} combines the subject with the {\em vp}.{\em Rule 4} deals with the complements of a vp.
\begin{figure}[htb]
\footnotesize
%\hrule
%\vspace{1em}
\begin{center}
\begin{avm}
\footnotesize
\[
\sc cat: & \sf v \cr %%\\
\sc lex: & \sf generate \cr %%\\
\sc subcat: & \< NP$_{\@1}$, NP$_{\@2}$ \> \cr %%\\
\sc sem: & \[ \sc pred: & \sf generate \cr %%\\
\sc arg1: & \@1 \cr %%\\
\sc arg2: & \@2
\]
\]\end{avm}
\vspace{.3in}
\begin{avm}
\[
\sc cat: & \sf n \cr %%\\
\sc lex: & \sf sentence \cr %%\\
\sc sem: & \[ \sc rel: & \sf sentence\cr %%\\
\]
\]
\end{avm}
\end{center}
\caption{Lexical entries for {\em sentence} and {\em program}}
\label{Lexical entry}
\end{figure}
%\begin{figure}[htb]
%\hrule
%\vspace{1em}
%\begin{verbatim}
% (1a) S -> adv, S
% (1b) S -> S, adv
% (2) S -> X, VP %% Subject consumption
% (3) VP -> adv, VP.
% (4) VP -> VP, X. %% subcategorization rule
% (5) VP -> V.
% (6) NP -> Det, N2.
% (7) N2 -> N.
% (8) N2 -> adj, N2.
%\end{verbatim}
%\caption{Grammar fragment}
%\label{Grammar fragment}
%\vspace{1em}
%\hrule
%\end{figure}
\begin{figure*}
\footnotesize
\begin{flushleft}\small\avmoptions{center}\sisterskip=0ex\daughterskip=5ex
\begin{tabular}{llll}
(1a) & \begin{avm}\[cat: & s \\ sem: & SEM \\ sem:mod: & [M\|MODS]\]\end{avm} & $\longrightarrow$ &
\begin{avm}\[cat: & adv \\ sem: M\]\end{avm}, \begin{avm}\[cat: & s \\ sem: & SEM \\ sem:mod: & MODS\]\end{avm}
\\ \\
(1b) & \begin{avm}\[cat: & s \\ sem: & SEM\\ sem:mod: & [M\|MODS]\]\end{avm} & $\longrightarrow$ & \begin{avm}\[cat: & s \\ sem: & SEM \\ sem:mod: & MODS\]\end{avm}, \begin{avm}\[cat: & adv \\ sem: M\]\end{avm}
\\ \\
(2) & \begin{avm}\[cat: & s \\ sem: & SEM\]\end{avm} & $\longrightarrow$ &
\begin{avm}\[cat: & np \\ sem: & SEM\_SUBJ\]\end{avm}, \begin{avm}\[cat: vp \\sem: SEM \\subcat: & [\begin{avm}\[cat: & np \\ sem: & SEM\_SUBJ\]\end{avm}]\]\end{avm}
\\ \\
(3) & \begin{avm}\[cat: & vp \\ sem: & SEM \\ sem:mod: & [MOD\|MODS]\]\end{avm} & $\longrightarrow$ & \begin{avm}\[cat: & adv \\ sem: & MOD\]\end{avm}, \begin{avm}\[cat: & vp \\ sem: & SEM \\ sem:mod: & MODS\]\end{avm}
\\ \\
(4) & \begin{avm}\[cat: & vp \\ sem: & SEM \\ subcat: & [SUBJ\|REST]\]\end{avm} & $\longrightarrow$ &
\begin{avm}\[cat: & vp \\ sem: & SEM \\ subcat: & [SUBJ,\begin{avm}\[cat: & X \\ sem: & SEM_X]\]\end{avm}\|REST]\]\end{avm}, \begin{avm}\[cat: & X \\ sem: & SEM_X\]\end{avm}
\\ \\
(5) & \begin{avm}\[cat: & vp \\ sem: & SEM \\ subcat: & SUBCAT\]\end{avm} & $\longrightarrow$ & \begin{avm}\[cat: & v \\ sem: & SEM \\ subcat: & SUBCAT\]\end{avm}
\\ \\
(6) & \begin{avm}\[cat: & np \\ sem: & SEM\]\end{avm} & $\longrightarrow$ &
\begin{avm}\[cat: & det\]\end{avm}, \begin{avm}\[cat: & n2 \\ sem: & SEM\]\end{avm}
\\ \\
(7) & \begin{avm}\[cat: & n2 \\ sem: & SEM\]\end{avm} & $\longrightarrow$ &
\begin{avm}\[cat: & n \\ sem: & SEM\]\end{avm}
\\ \\
(8) & \begin{avm}\[cat: & n2 \\ sem: & SEM \\ sem:mod: & [MOD\|MODS]\]\end{avm} & $\longrightarrow$ &
\begin{avm}\[cat: adj \\ sem: & SEM\]\end{avm}, \begin{avm}\[cat: & n2 \\ sem: & SEM \\ sem:mod: & MODS\]\end{avm}
\end{tabular}
\end{flushleft}
\caption{Grammar Fragment.Only semantic information is shown}
\label{grammar fragment}
%\normalsize
\end{figure*}
The analysis of the sentence {\em The little prolog program generated the complex
sentence quickly} is shown in Figure~\ref{Input semantics}.\footnote{The example is due to Nicolas Nicolov.} Note that input semantics
represents the deep predicate argument structure of sentences for the generator;
modifiers are contained in set-valued feature ``mod''.%%\footnote{We assume
%%that set-valued features are modelled as (Prolog) lists.}
%%Note also that input representations are encoded as (possible typed)
%%Feature Structures.
%% Primera figura
%\begin{small}
\begin{figure*} %%[htb]
%\hrule
%\vspace{1em}
\begin{center}
%%\footnotesize
\begin{avm}
\footnotesize
\[
\sc mod: & \< \sf quick \> \cr %%\\
\sc pred: & \sf generate \cr %%\\
\sc arg1: & \[ \sc def: & + \cr %%\\
\sc mod: & \sf \< little, prolog \> \cr %%\\
\sc rel: & \sf program \cr %%\\
\] \cr %%\\
\sc arg2: & \[ \sc def: & +\cr %%\\
\sc mod: & \< \sf complex \> \cr %%\\
\sc rel: & \sf sentence
\]
\]
\end{avm}
\end{center}
\caption{Input semantics}
\label{Input semantics}
%\vspace{1em}
%\hrule
\end{figure*}
%\end{small}
First we look at the results we obtain after applying former generation methods on
f-structure representations and then we describe the
SKG algorithm.
For expository purposes we will use the graphical notation used in \cite{Koenig:syn} to describe the generation algorithms. Following \cite{Koenig:syn}: we will assume that the syntax-semantics-relation for a given grammar is stated by pairs of trees. The left tree shows a local syntactic dependency, whereas the right tree defines a local semantic dependency. We also assume that there is a one-to-one mapping from the nonterminal leaf nodes of the syntactic tree to the leaf nodes of the local semantic tree. Note that this is only a graphical notation for the {\em rule-to-rule hypothesis}, i.e., the fact that in the grammar each syntactic rule is related to a semantic analysis rule. An example is given below:
%\begin{small}
%\small
\begin{equation}
\begin{array}{c}
\\
\treepair
{
\begin{array}{cc}
\multicolumn{2}{c}{
\node
{a}
{s}}
\\
\\
\node
{b}
{np}
&
\node
{c}
{vp}
\end{array}
}
{
\begin{array}{cc}
\multicolumn{2}{c}{
\node
{d}
{VP(NP)}}
\\
\\
\node
{e}
{NP}
&
\node
{f}
{VP}
\end{array}
}
\\ \mbox{}
\end{array}
% first tree
\nodeconnect[b]{a}[t]{b}
\nodeconnect[b]{a}[t]{c}
% second tree
\nodeconnect[b]{d}[t]{e}
\nodeconnect[b]{d}[t]{f}
% links
\makedash{3pt}
\barnodeconnect[1em]{a}{d}
\barnodeconnect[-1em]{b}{e}
\barnodeconnect[-0.5em]{c}{f}
\end{equation}
%%\end{small}
%% Head Corner Generator
The head-corner generator (\cite{Noord:th}, a variant of SHDG) and SynHDG are (graphically) described in Figure~\ref{hcgen} (taken directly from \cite{Koenig:syn}). The {\em lex} rule is the {\em prediction step} of the algorithm, i.e. it restricts the selection of lexical entries to those that can be linked with the local goal (visualized by a dotted line). The{\em hc\_complete} rule is the {\em bottom-up step} which selects a rule for which $\categ{h}$ is the syntactic head and $\semi{h}$ is the semantic head. As a result, it also predicts the head's sisters, which have to be expanded recursively ({\em top-down prediction}).
The difference between SHDG and SynHDG is the link relation for semantic structures: in \cite{Noord:th} the {\em semantic-based link relation} is defined as follows:
%\begin{small}
\begin{equation}
link(\semi{},\semi{i})
\mbox{\ \ {\em if\/}}
\end{equation}
%\end{small}
$\semi{}$ and $\semi{i}$ are {\em identical}. If we represent semantics using first order terms, then we only have to check whether $\semi{}$ and $\semi{i}$ unify.
As for the SynHDG algorithm, the {\em semantic-based link relation} is defined as follows \cite{Koenig:syn}:
\begin{equation}
link(\semi{},\semi{i})
\mbox{\ \ {\em if\/}}
\end{equation}
$\semi{i}$ is a substructure of $\semi{}$. In practical terms, $\semi{i}$ is an element of the bag of semantic keywords that constitute $\semi{}$ \cite{Lex:95}.
%%\begin{small}
\begin{figure*}
%\small
\footnotesize
all leaves are labeled with terminals and the tree does not contain
any dotted lines
%%\hspace{2em}
\hspace{1em}
\rname{global-success}
\\[1em]
\begin{math}
\infrule
{\treepair
{\linkrel
{\vddtree
{\categ}
}
{\vdrtree
{\categ}
}
}
{\linkrel
{\vddtree
{\semi{}}
}
{\vdrtree
{\semi{}}
}
}
}
{\treepair
{\stackedtrees
{\vddtree
{\categ}}
{\vdrtree
{}}
}
{\stackedtrees
{\vddtree
{\semi{}}}
{\vdrtree
{}}
}
}
{local-success}
\end{math}
%%\\[1em]
\\[.5em]
\begin{math}
\infrule
{
\treepair
{
\vddtree
{\categ}
}
{
\vddtree
{\semi{}}
}
}
{
\treepair
{\linkrel
{\vddtree
{\categ}
}
{
\unatree
{\categi{i}}
{\lexemi{i}}
}
}
{\linkrel
{\vddtree
{\semi{}}
}
{\semi{i}
}
}
}
{lex}
\hspace{1em}
\mbox{{\em if\ }}
\treepair
{\unatree
{\categi{i}}
{\lexemi{i}}
}
{\semi{i}}
\in \grami{}
\mbox{\ {\em and}\ }
link(\langle\categ,\semi{}\rangle,\langle\categi{i},\semi{i}\rangle)
\end{math}
%%\\[1em]
\\[.5em]
\begin{math}
\infrule
{
\treepair
{\linkrel
{\vddtree{\categ}}
{\vdrtree
{\categi{h}}
}
}
{\linkrel
{\vddtree{\semi{}}}
{\vdrtree
{\semi{h}}
}
}
}
{
\treepair
{\linkrel
{\vddtree{\categ}}
{
\begin{array}{c}
\vdtree
{\categi{0}}
{\categi{1} \ldots \categi{h} \ldots \categi{n}} \\[-0.5em]
\vdrtree
{}
\end{array}
}
}
{\linkrel
{\vddtree{\semi{}}}
{\begin{array}{c}
\vdtree
{\semi{0}}
{\semi{1} \ldots \semi{h} \ldots \semi{n}} \\[-0.5em]
\vdrtree
{}
\end{array}
}
}
}
{hc\_complete}
\end{math}
\begin{flushright}
{\em if\ }
$\treepair
{\vdtree
{\categi{0}}
{\categi{1} \ldots \categi{h} \ldots \categi{n}}}
{\vdtree
{\semi{0}}
{\semi{1} \ldots \semi{h} \ldots \semi{n}}}
\in \grami{}$
\end{flushright}
\caption{Head-Corner Generator
($\grami{}$ grammar description;
$\categi{i}$ syntactic category;
$\semi{i}$ semantic representation) (Taken from \cite{Koenig:syn}) }
\label{hcgen}
%\normalsize
\end{figure*}
%%\end{small}
%% Explicacio SHDG
\subsection{The direct application of former generation procedures to
f-structure representations}
We will illustrate the problems SHDG (more specifically, a variant of it: the head-corner generator described in \cite{Noord:th}) runs into when dealing with f-structures by following its application to the input semantics given below (which corresponds to the np {\em the complex sentence}):
%%\begin{small}
\begin{equation}
\label{input-complex}
\begin{avm}\[cat: & np \\ sem: & \begin{avm}\[rel: & sentence \\ def: & + \\ mod: & [complex]\]\end{avm}\]\end{avm}
\end{equation}
%%\end{small}
According to the algorithm described in Figure~\ref{hcgen}, and due to the {\em syntactic-head} and {\em semantic-head link relation}, the {\em lex} rule can only be applied to the lexical entry for {\em sentence} (Figure~\ref{Lexical entry}). However, since the semantic link relation is defined in terms of {\em unification}, applying rule {\em lex} leads to a new semantic goal which is {\em identical} to the input semantics. Next we need to apply to apply the {\em hc\_complete} rule; rule {\em 7} is the only possible candidate. After applying it, our current goal is the following:
%\begin{small}
\begin{equation}
\begin{avm}\[cat: & n2 \\ sem: & \begin{avm}\[rel: & sentence \\ def: & + \\ mod: & [complex]\]\end{avm}\]\end{avm}
\end{equation}
%\end{small}
At this point, a new {\em hc\_complete} step needs to be taken. Now we have two candidates: rules {\em 6} and {\em 8}. If we select rule {\em 6}, and after generating recursively the determiner, we end up having generated only part of the sentence: {\em the sentence}. Rule {\em 8}, in its turn, can be {\em always} selected; consequently, we could end up having semantic goals that would look like that:
%\begin{small}
\begin{equation}
\begin{avm}\[cat: & n2 \\ sem: & \begin{avm}\[rel: & sentence \\ def: & + \\ mod: & [X,\ldots\|complex]\]\end{avm}\]\end{avm}
\end{equation}
%\end{small}
In other words, {\em the generator would loop and would not terminate}.
The problems discussed above lead us to the following conclusion: the SHDG generator is {\em neither complete nor coherent}. These issues also arise with first order terms (see discussion in \cite{Shieb:90}); the problem here is that we lack the definition of grounded feature structures.
\subsection{Semantic Kernel Generator}
%As it has been already mentioned, our concern here is the design of a procedure that
%generates directly from f-structure representations and which keeps
%the main merits of existing generation algorithms.
%Then we sketch the main ideas behind this new method and we explain
%the main differences between SKG and SHDG. We also make explicit the
%assumptions under which the algorithm works.
%%Although we have found some problems applying SHDG to the grammar in Figure~\ref{grammar fragment}, it is
%%not very difficult to come up with a {\em coherent and complete} variant of SHDG
%%. In any case,
%%it seems that the generator needs some knowledge about the semantic
%%structure of a sign.
%%For our grammar, the generator should know that only the ``sem:nuc'' feature
%%contains the necessary information for the prediction step.
The main assumption behind the SKG algorithm is that the generator is capable of distinguishing
between the following
types of semantic information within input structures:
%\begin{small}
\begin{itemize}
\item {\bf Semantic Kernel (SK) Information}: Semantic structure completely
which is predictible from the lexicon (i.e, there is at least one lexical
entry which subsumes this structure).
\item {\bf Non Semantic Kernel (Non-SK) Information}: Semantic structure
which is not predictible from any lexical entry (typically, lists).
In our grammar, modifiers are represented as a list. This list is
Non-SK information.
\end{itemize}
%\end{small}
Similarly, the generator is given the following information with respect to
the types of rules:
%\begin{small}
\begin{itemize}
\item {\bf SK Rules}: Rules which do not add Non-SK information.
\item {\bf Non-SK Rules}: Rules which add Non-SK information. Rules 1,3,8 in
our grammar.
%\footnote{Thes rules are similar to {\em non-chain-rules}}
\end{itemize}
%\end{small}
The hypothesis behind this classification is that of {\em structural
predictibility}: SK information comes from the lexicon (i.e, SK information can be seen as grounded feature terms), and non SK information is introduced through rules. In other words, the generator knows whether each type of input structure comes from a lexical entry or whether it has been constructed from a (non SK) rule. Thus, the restrictedness of the algorithm is due to the fact that it operates under the assumption
that we can recursively decompose each input structure into SK and Non-SK
information. %%Although this restriction seems to be rather strong, the generator
%%gives the right answers for the problematic flat f-structure
%%representations containing sentence modifiers.\footnote{Identical remarks
%%have been already done in the LFG framework \cite{Wede:93}, \cite{Wede2:93}.}
%%It is worth
%%mentioning that in the SHDG algorithm from \cite{Noord:th} semantic
%%representations (logical forms) are SK information. In other words,
%%its structure is completely predicted from the lexicon.
A graphical version of the SKG algorithm is given in Figure~\ref{skgen}.
%%and a simplified prolog-version is given in Figure~\ref{prolog-version}.
%%Further on an example will be given that shows how the algorithm works.
%\begin{figure*}
%\footnotesize
%\begin{verbatim}
%% Initial Goal
%skgen(Goal,EndString) :-
% has_only_sk(Goal),
% predict_head(Goal,IniString,IntermGoal),
% skhead_corner(Goal,IntermGoal,IniString,EndString).
%
%skgen(Goal,EndString) :-
% has_non_sk(Goal,SubGoals),
% decompose(Goal,SK_structures,NonSK_structures),
% sk_obtain_subgoals(Goal,
% SK_structures,
% NonSK_structures,
% SubGoals),
% generate_top_down(SubGoals,Strings),
% combine(Strings,EndString).
%
%%% Prediction step
%predict_head(Goal,IniString,IntermGoal) :-
% lex_entry(Entry,IniString,Syn,Sem),
% syn_link(Goal,Syn),
% sk(Goal,GoalSem),
% unify(GoalSem,Sem).
%
%%% Head Corner Step
%skhead_corner(Goal,Goal,String,String).
%skhead_corner(Goal,Intermgoal,IniString,EndString) :-
% select_nonsk_rule(IntermGoal,NewGoal,Daughters),
% syn_link(Goal,NewGoal),
% generate_top_down(Daughters,List_Strings),
% combine(IniString,List_Strings,NewString),
% skhead_corner(Goal,NewGoal,NewString,EndString).
%
%%% Top down expansion
%generate_top_down([],[]).
%generate_top_down([Goal|Rest],EndString) :-
% skgen(Goal,String1),
% generate_top_down(Rest,List_Strings),
% combine(String1,List_Strings,EndString).
%
%%% Specific Information for each grammar. !!
%sk_obtain_subgoals((cat:np),
% SK_structure,
% NonSK_structure,
% [(cat:det & sem:SEM1),(cat:n2 & sem:SEM2)]) :-
% select_sk(SK_structure,New_SK_structure,SEM1),
% join(New_SK_strucure,NonSK_structure,SEM2).
%
%sk_obtain_subgoals((cat:n2),
% SK_structure,
% NonSK_structure,
% [(cat:adj & sem:SEM1),(cat:n2 & sem:SEM2)]) :-
% select_nonsk(NonSK_structure,New_nonSK_structure,SEM1),
% join(New_nonSK_structure,SK_structure,SEM2).
%
%...
%\end{verbatim}
%\caption{Simplified prolog version of the SKG algorithm}
%\label{prolog-version}
%\end{figure*}
%%and a simplified prolog version is given in ~\ref{prologskgen}. Note that SK-rules are never applied directly (predicate {\em compute-new-syn-goal} in rule {\em sk-head} in the prolog version, which corresponds to the second {\em head-corner completion step} of the graphical version) and that the {\em head-corner completion step} for SK information does not include SK rules (predicate {\em check-non-sk-rules} in rule {\em sk_head_corner} in the prolog version, which corresponds to the first {\em head-corner completion step} of the graphical notation).
%% L'algoritme SKG
%\begin{figure}[htb]
%\label{prologskgen}
%\begin{verbatim}
%skgen(Goal,String) :-
% sk_head(SynGoal,SemGoal,String).
%
%sk_head(SemGoal,String) :-
% only_sk_info(SemGoal),
% predict_skhead(SemGoal,NewGoal,Entry),
% sk_head_corner(SemGoal,NewGoal,Entry,String).
%
%sk_head(SemGoal,String) :-
% there_is_nonsk_info(SemGoal),
% skgen(SK_Goal),
% skgen(NonSK_Goal),
% compute_new_SynGoal(SynGoal,NewSynGoal),
% sk_head_corner(SemGoal,NewSemGoal,String,EndString).
%
%sk_head_corner(Goal,Goal,String,String).
%sk_head_corner(Goal,SubGoal,String,EndString) :-
% rule(Id,NewGoal,NewSubGoals),
% non_sk_rule(Id),
% sk_daughters(NewSubGoals), %% top-down step
% sk_head_corner(Goal,NewGoal,NewString,String).
%\end{verbatim}
%\caption{A simplified version of the SKG algorithm}
%\label{prologskgen}
%\end{figure}
%
\begin{figure*}
all leaves are labeled with terminals and the tree does not contain
any dotted lines
\hspace{2em}
\rname{global-success}
\\[1em]
\begin{math}
\infrule
{\treepair
{\linkrel
{\vddtree
{\categ}
}
{\vdrtree
{\categ}
}
}
{\linkrel
{\vddtree
{\semi{}}
}
{\vdrtree
{\semi{}}
}
}
}
{\treepair
{\stackedtrees
{\vddtree
{\categ}}
{\vdrtree
{}}
}
{\stackedtrees
{\vddtree
{\semi{}}}
{\vdrtree
{}}
}
}
{local-success}
\end{math}
\\[1em]
\begin{math}
\infrule
{
\treepair
{
\vddtree
{\categ}
}
{
\vddtree
{\semi{}}
}
}
{
\treepair
{\linkrel
{\vddtree
{\categ}
}
{
\unatree
{\categi{i}}
{\lexemi{i}}
}
}
{\linkrel
{\vddtree
{\semi{}}
}
{\semi{i}
}
}
}
{lex}
%%\hspace{1em}
\\[1em]
\mbox{{\em if\ }}
\treepair
{\unatree
{\categi{i}}
{\lexemi{i}}
}
{\semi{i}}
\in \grami{}
\mbox{\ {\em and}\ }
link(\categ,\categi{i}) \mbox{\ {\em and}\ } sk(\semi{},\semi{i})
\mbox{\ {\em and}\ } SK(\semi{})
\end{math}
\\[1em]
\begin{math}
\infrule
{
\treepair
{\linkrel
{\vddtree{\categ}}
{\vdrtree
{\categi{h}}
}
}
{\linkrel
{\vddtree{\semi{}}}
{\vdrtree
{\semi{h}}
}
}
}
{
\treepair
{\linkrel
{\vddtree{\categ}}
{
\begin{array}{c}
\vdtree
{\categi{0}}
{\categi{1} \ldots \categi{h} \ldots \categi{n}} \\[-0.5em]
\vdrtree
{}
\end{array}
}
}
{\linkrel
{\vddtree{\semi{}}}
{\begin{array}{c}
\vdtree
{\semi{0}}
{\semi{1} \ldots \semi{h} \ldots \semi{n}} \\[-0.5em]
\vdrtree
{}
\end{array}
}
}
}
{hc\_complete}
\end{math}
%\begin{ushright}
\\[1em]
\begin{flushright}
{\em if\ }
$\treepair
{\vdtree
{\categi{0}}
{\categi{1} \ldots \categi{h} \ldots \categi{n}}}
{\vdtree
{\semi{0}}
{\semi{1} \ldots \semi{h} \ldots \semi{n}}}
\in \grami{SK}$
\mbox{\ {\em and}\ }
$SK(\semi{})$
\end{flushright}
%\\[1em]
\begin{math}
\infrule
{
\treepair
{\linkrel
{\vddtree{\categ}}
{\vdrtree
{\categi{h}}
}
}
{\linkrel
{\vddtree{\semi{}}}
{\vdrtree
{\semi{h}}
}
}
}
{
\treepair
%{\linkrel
%{\vddtree{\categ}}
{
\begin{array}{c}
\vdtree
{\categi{}}
{\categi{1} \ldots \categi{h} \ldots \categi{n}} \\[-0.5em]
\vdrtree
{}
\end{array}
}
%}
%{\linkrel
%{\vddtree{\semi{}}}
{\begin{array}{c}
\vdtree
{\semi{}}
{\semi{1} \ldots \semi{h} \ldots \semi{n}} \\[-0.5em]
\vdrtree
{}
\end{array}
}
%}
}
{hc\_complete}
\end{math}
%\begin{ushright}
\\[1em]
\begin{flushright}
{\em if\ }
$\treepair
{\vdtree
{\categi{}}
{\categi{1} \ldots \categi{h} \ldots \categi{n}}}
{\vdtree
{\semi{}}
{\semi{1} \ldots \semi{h} \ldots \semi{n}}}
\in \grami{}$
\mbox{\ {\em and}\ }
$\neg$ $SK(\semi{})$
\mbox{\ {\em and}\ }
sk(\semi{},\semi{h})
\end{flushright}
\caption{Semantic Kernel Generator
($\grami{}$ grammar description;
$\categi{i}$ syntactic category;
$\semi{i}$ semantic representation;
$SK(\semi{})$ is true if $\semi{}$ contains only SK information;
$\grami{SK}$ grammar description with only SK rules;
$\grami{\neg SK}$ grammar description with only nonSK rules;
$sk(\semi{},\semi{h})$ is true if $\semi{h}$ is SK information of $\semi{}$
(Adapted from \cite{Koenig:syn}) }
\label{skgen}
\end{figure*}
In sum, this is the information the generator needs to know about
the grammar:%%\footnote{All this information can be collected off-line from the grammar, though in the current implementation it has been done by hand.}
%\begin{small}
\begin{itemize}
\item link relation (head relation).
\item The SK and Non-SK substructures of a given semantic representation.
%\item the Non-SK substructure of a given semantic representation.
\item The distinction between SK rules and Non-SK rules.
\item The syntactic goals to generate SK and Non-SK information.
%\item The syntactic goals for generating Non-SK information.
\item The syntactic goal we obtain after combining SK and Non-SK
information.
\end{itemize}
%\end{small}
In order to show how the SKG algorithm works we will follow its application to the input semantics for {\em the complex sentence} given in example ~\ref{input-complex}. For this input semantics, we have two SK structures:
%\begin{small}
\begin{equation}
\begin{avm}\[rel: & sentence \]\end{avm}
\end{equation}
\begin{equation}
\begin{avm}\[def: & + \]\end{avm}
\end{equation}
%\end{small}
and one nonSK structure:
%\begin{small}
\begin{equation}
\begin{avm}\[mods: & [complex] \]\end{avm}
\end{equation}
%\end{small}
The {\em lex} rule cannot be applied because of the SK structure condition: input semantics has nonSK information. Thus, we can only apply the second {\em hc\_corner step}. This forces us to start from {\em rule 6} and generate (top-down) the following goals:
%\begin{small}
\begin{equation}
\begin{avm}\[cat: & det \\ sem: & \begin{avm}\[def: & +\]\end{avm}\]\end{avm}
\end{equation}
\begin{equation}
\label{n2goal}
\begin{avm}\[cat: & n2 \\ sem: & \begin{avm}\[rel: & sentence \\ mods: & [complex]\]\end{avm}\]\end{avm}
\end{equation}
%\end{small}
Note that the generator has been told about the relation between nonSK information and SK and nonSK rules, therefore it knows where the modifiers come from. The determiners generation is reduced to applying the {\em lex} rule. To generate the {\em n2} goal (example ~\ref{n2goal}) we proceed as before; this goal has nonSK information, so the generator starts from {\em rule 8} and generates (top-down) the appropriate subgoals:
%\begin{small}
\begin{equation}
\label{sentence-goal}
\begin{avm}\[cat: & n2 \\ sem: & \begin{avm}\[rel: & sentence\]\end{avm}\]\end{avm}
\end{equation}
\begin{equation}
%\label{n2goal}
\begin{avm}\[cat: & adj \\ sem: & \begin{avm}\[rel: & complex\]\end{avm}\]\end{avm}
\end{equation}
%\end{small}
The generation of the subgoals above is straightforward, since they do not contain nonSK information and the {\em lex} rule can be applied without problems. The application of the {\em hc\_corner step} to each of the subgoals deserves further comments, since we are runing the risk of having {\em termination} problems. For example, once we have applied the {\em lex} rule and the {\em hc\_corner} step for {\em sentence} we obtain the goal in example ~\ref{sentence-goal}. One may wonder whether we could apply rule {\em 8} again and end up having subgoals like the following:
%\begin{small}
\begin{equation}
\begin{avm}\[cat: & n2 \\ sem: & \begin{avm}\[rel: & sentence \\ mods: & [X,\ldots]\]\end{avm}\]\end{avm}
\end{equation}
%\end{small}
{\em This situation is not possible}, since if we only have SK information only SK rules can be applied, and rule {\em 8} is a nonSK rule (see conditions on {\em hc\_complete step (1)} in Figure~\ref{skgen}).
Another example will clarify how the generator works. Assuming we want to
generate a string for the semantic representation in
Figure~\ref{Input semantics},
the following sentences should be generated according to the grammar:\footnote{In this example we will only concentrate in the generation of {\em quickly} at sentence or vp level; the rest of modifiers ({\em complex, little, prolog}) for the np level would be generated in an identical manner.}
%\begin{small}
\begin{itemize}
\item {\em the \{little,prolog\} program generated the complex sentence quickly}.
\item {\em quickly the \{little,prolog\} program generated the complex sentence}.
\item {\em the \{little,prolog\} program quickly generated the complex sentence}.
\end{itemize}
%\end{small}
The generator detects that the semantic representation consists of both
a SK structure and a Non-SK structure (``quickly''). Thus, according to
the grammar, there are several ways of generating these structures
given the original goal (which is a sentence). The generator tries the following combinations:
%\begin{small}
\begin{itemize}
\item It generates a ``S'' string for the SK information and a
``adv'' string for the Non-SK information. Both strings can
be combined in two ways (which corresponds to rules R1a and R1b). This
gives us two of the possibilities.
\item It generates a ``VP'' string for the SK information and
``adv'' string for the Non-SK information (this
corresponds to rule R3). After generating these strings, and
according to rule R2, we link the ``VP'' to ``S''
\end{itemize}
%\end{small}
%SK information can be generated using the original SHDG algorithm, but
%without using Non-SK rules. For Non-SK information, we assume that
%we can find the SK information for generating the appropriate goal.
\section{Discussion}
The SKG generator proceeds top-down, generating the appropriate subgoals, when it finds nonSK information.
It proceeds bottom-up when lexical prediction can be made (when there is only SK information), and the {\em head-corner step} for SK information can only be performed using SK rules, thus avoiding {\em termination} problems.
%%The benefits and drawbacks of our proposal are clear: the generator has the same processing strategy as the SHDG and it is complete and coherent, but it needs more information about the grammar.
The way our generator works and
the distinction between SK and Non-SK information resembles the definition
of the {\em restrictor} operator and the treatment of modifiers given in
\cite{Wede:93}. The difference is obviously the context of application: In \cite{Wede:93}
the main interest is structural misalignment between f-structure and semantic
representations, whereas our concern is string generation from f-structure
representations.
%Another point that deserves further attention is the way the generator is told
%to compute SK and Non-SK information. We believe that this kind of information
%could be derived from semantic information encoded within lexical entries in
%a typed feature structures framework. We admit that this is rather
%speculative, though. If this is not possible, our generator can be seen as a
%metagenerator for f-structure representations.
\section{Implementation}
Our framework has been the Sicstus-Prolog version of the CUF language %%\footnote{CUF is an extension of Prolog by feature terms, types and a sophisticated evaluation strategy
\cite{Cuf:93} plus a layer on top of it which implements the grammar formalism, the (left-corner) parser and the SKG generator.%%\footnote{Code is available from the author.}
\section{Conclusions}
We have shown that for f-structure representations previously proposed
generation algorithms run into problems, and therefore, we have presented an alternative:
the SKG algorithm.
The main assumptions behind the algorithm is the following: for each semantic input it is possible to compute
its SK and Non-SK information. We have also shown that our approach resembles
the definition of the {\em restrictor} operator and the treatment of modifiers given
in \cite{Wede:93} to deal with structural misaligments between f-structure
and semantic representations.
%%\section{Future work}
%%We are currently investigating how to derive (semi)automatically the SK and nonSK information from the grammar and lexical entries. We also plan to incorporate the ideas presented in \cite{Kay:96} (chart generation for flat semantic representations) to our algorithm.
\section{Acknowledgments}
I would like to thank Esther K\"{o}nig, Michael Dorna and Nicolas Nicolov for valuable comments on the ideas presented in this paper, and to Cristina Corcoll for spellchecking it. Obviously, I am responsible for any mistake.
\begin{thebibliography}{}
\begin{scriptsize}
%%\bibitem[Busemann,1996]{Buse:96}
%%Stephan Busemann.
%%\newblock 1996.
%%\newblock The interface between Constraint-Based Grammars and Generation Systems.
%%\newblock Draft paper.
%\bibitem[Beaven,1992]{Beaven:92}
%\newblock J.L.Beaven.
%\newblock {\em Lexicalist
%Unification-based Machine Translation}.
%\newblock Ph.D thesis, University of Edinburgh.
%\bibitem[Carpenter,1992]{Carpenter:92}
%\newblock B.Carpenter.
%\newblock {\em The Logic of Typed Feature Structures}.
%\newblock Cambridge University Press, 1992.
\bibitem[D\"orre \& Dorna 1993]{Cuf:93}
(D\"orre \& Dorna 93) D\"orre J. and Dorna M.
\newblock 1993.
\newblock CUF - A Formalism for Linguistic Knowledge Representation.
\newblock Deliverable R.1.2A, DYANA, Institut f\"ur Maschinelle Sprachverarbeitung, University of Stuttgart, Germany.
%\bibitem[Kaplan and Wedekind, 1993]{Wede2:93}
%Kaplan, R. and Wedekind, J.
%\newblock 1993.
%\newblock Restriction and Correspondence-based Translation.
%\newblock In {\em Proceedings of EACL-93}, Utrecht, The Nederlands.
%%\bibitem[Kay,1996]{Kay:96}
%%Martin Kay.
%%\newblock 1996.
%%\newblock Chart Generation.
%%\newblock In {\em Proceedings of ACL-96}
\bibitem[K\"onig 1994]{Koenig:syn}
(K\"onig 94) Esther K\"onig.
\newblock 1994.
\newblock Syntactic-Head Driven Generation.
\newblock In {\em Proceedings of Coling-94}, Kyoto, Japan.
\bibitem[K\"onig 1995]{Lex:95}
(K\"onig 95) Esther K\"onig.
\newblock 1995.
\newblock LexGram - a practical categorial grammar formalism.
\newblock In {\em Proceedings of CLNLP-95}, Edinburgh, Scotland.
\bibitem[K\"oenig 1996]{Koenig:pers}
(K\"onig 96) Esther K\"onig.
\newblock 1996.
\newblock Personal communication.
\bibitem[Nicolov {\it et al.} 1996]{Nicpers:96}
(Nicolov {\it et al.} 96) N.Nicolov \& C.Mellish and T.Tuells.
\newblock Mixed Semantic-Syntactic Head Driven Generation for Constraint-based Grammars.
\newblock 1996.
\newblock Draft paper.
%\bibitem[Nicolov {\it al.} 1996]{Nic:96}
%Nicolov N., Mellish C. and Ritchie G.
%\newblock 1996.
%\newblock Approximate Generation from Non-Hierarchical Representations.
%\newblock In {\em Proceedings of the 8th International Workshop on Natural
%Language Generation}, Herstmonceaux Castle, U.K.
\bibitem[Noord 1993]{Noord:th}
(Noord 93) Gertjan van Noord.
\newblock 1993.
\newblock {\em Reversibility in Natural Language Processing}.
\newblock PhD thesis, University of Utrecht.
\bibitem[Shieber {\it et al.} 1990]{Shieb:90}
(Shieber {\it et al.} 90) Shieber S., van Noord G., Moore R. and Pereira F.
\newblock1990.
\newblock Semantic-head-driven Generation.
\newblock In {\em Computational Linguistics}, 16(1)
\bibitem[Wedekind \& Kaplan 1993]{Wede:93}
(Wedekind \& Kaplan 93) Wedekind, J. and Kaplan, R.
\newblock 1993.
\newblock Type-Driven Semantic Interpretation of f-structures.
\newblock In {\em Proceedings of EACL-93}, Utrecht, The Nederlands.
\end{scriptsize}
\end{thebibliography}
\end{document}