# Prawitz Style Derivations for Categorial Grammar in LaTeX with Semantic Package

[ LaTeX for Linguists, .dvi, .ps, .pdf]

## Luiz Arthur Pagani1

• Footnotes

• [This file is also available as PostScript, pdf, or dvi]

Categorial grammarians often represent linguistic structures as Prawitz style derivations. For a simple sentence such as "he likes him", the derivation is seen in Figure *. Such diagrams can be drawn with the semantic package, developed by Peter Moller Neergaard and Arne John Glenstrup, and is installed with MikTeX (at least in the large option, but it can be easily installed with MikTeX Package Manager). If you don´t use MikTeX, the package can be downloaded from CTAN. In order to load the package you must include in the preamble of the document the following directive:

\usepackage[inference]{semantic]


\inference
{ \inference
{ \inference{he}{S/(N\backslash S)}[Lex]
& \inference{likes}{(N\backslash S)/N}[Lex]
}
{S/N}
[$>$C]
& \inference{him}{(S/N)\backslash S}[Lex]
}
{S}
[$<$A]

Derivation of "he likes him"

The \inference command takes two obligatory arguments and two optional arguments:

 \inference{Premises}{Conclusion}

 \inference[Label Before]{Premises}{Conclusion}[Label After]

Notice that the arguments to \inference are set in math mode, so logical symbols, etc. can be included, as in Figure *. The space between the premises can be controlled by \setpremisesend, \setpremisesspace, and \setnamespace. These space parameters take scope only over the first \inference command, so they should be set for every derivation whose appearance must be different from the default (but they continue the same in the nested inference).

\setpremisesend{0pt}
\setpremisesspace{1pt}
\setnamespace{0pt}
\inference
{ \inference
{ \inference{he}{S/(N\backslash S): \lambda P[P(x_1)]}[Lex]
& \inference{likes}{(N\backslash S)/N: like}[Lex]
}
{S/N: \lambda y[like(y)(x_1)]}
[$>$C]
& \inference{him}{(S/N)\backslash S: \lambda P[P(x_2)]}[Lex]
}
{S: like(x_2)(x_1)}
[$<$A]

Diagram of "he likes him" with semantic representation

To obtain multiple lines in premises or conclusions (e.g. to show explicitly the effects of beta-reduction), arrays can be used, as in Figure *.

\setpremisesend{0pt}
\setpremisesspace{1pt}
\setnamespace{0pt}
\inference
{ \inference
{ \inference{he}{S/(N\backslash S): \lambda P[P(x_1)]}[Lex]
& \inference{likes}{(N\backslash S)/N: like}[Lex]
}
{S/N:
\begin{array}[t]{l}
\lambda P[P(x_1)] ( like )\\
\lambda y[like(y)(x_1)]
\end{array}
}
[$>$C]
& \inference{him}{(S/N)\backslash S: \lambda P[P(x_2)]}[Lex]
}
{S:
\begin{array}[t]{l}
\lambda P[P(x_2)] ( \lambda y[like(y)(x_1)] )\\
\lambda y[like(y)(x_1)] (x_2)\\
like(x_2)(x_1)
\end{array}
}
[$<$A]

Diagram of "he likes him" with semantic representation

In the following are the most common diagrams used in Categorial Grammar, but I use Prawitz style diagram with more liberality in order to represent agreement. And instead of locating premises above and conclusions below the horizontal bar I put expressions and semantic representations, and the category is moved to the left of the bar. Such liberality is motivated by the necessity of include agreement facts, that abound in Portuguese. So, the structure of the sentence "ele ama você" (he loves you) will be as in Figure *. Note that the citation form of the verb is "amar" and when it agrees with the third person subject it becomes "ama".

\setpremisesend{0pt}
\setpremisesspace{1pt}
\setnamespace{0pt}
\inference
[S]
{ \inference
[S/N]
{ \inference
[S/(N$\backslash$S)]
{\mbox{ele}}
{\lambda P[P(x_1)]}
[Lex]
& \inference
[(N$\backslash$S)/N]
{\mbox{amar}}
{love}
[Lex]
\\ \mbox{ele ama}
}
{\lambda y[love(y)(x_1)] }
[$>$C]
& \inference
[(S/N)$\backslash$S]
{\mbox{voc\^e}}
{\lambda Q[Q(x_2)]}
[Lex]
\\ \mbox{ele ama voc\^e}
}
{love(x_2)(x_1)}
[$<$A]

Diagram of "ele ama você" including agreement

LaTeX for Linguists,
Doug Arnold,
doug@essex.ac.uk,
May 19, 2005.

Accessed times.