rm old tutorials
@@ -1,14 +0,0 @@
|
||||
abstract Food = {
|
||||
|
||||
cat
|
||||
S ; Item ; Kind ; Quality ;
|
||||
|
||||
fun
|
||||
Is : Item -> Quality -> S ;
|
||||
This, That : Kind -> Item ;
|
||||
QKind : Quality -> Kind -> Kind ;
|
||||
Wine, Cheese, Fish : Kind ;
|
||||
Very : Quality -> Quality ;
|
||||
Fresh, Warm, Italian, Expensive, Delicious, Boring : Quality ;
|
||||
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
concrete FoodEng of Food = {
|
||||
|
||||
lincat
|
||||
S, Item, Kind, Quality = {s : Str} ;
|
||||
|
||||
lin
|
||||
Is item quality = {s = item.s ++ "is" ++ quality.s} ;
|
||||
This kind = {s = "this" ++ kind.s} ;
|
||||
That kind = {s = "that" ++ kind.s} ;
|
||||
QKind quality kind = {s = quality.s ++ kind.s} ;
|
||||
Wine = {s = "wine"} ;
|
||||
Cheese = {s = "cheese"} ;
|
||||
Fish = {s = "fish"} ;
|
||||
Very quality = {s = "very" ++ quality.s} ;
|
||||
Fresh = {s = "fresh"} ;
|
||||
Warm = {s = "warm"} ;
|
||||
Italian = {s = "Italian"} ;
|
||||
Expensive = {s = "expensive"} ;
|
||||
Delicious = {s = "delicious"} ;
|
||||
Boring = {s = "boring"} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
concrete FoodIta of Food = {
|
||||
|
||||
lincat
|
||||
S, Item, Kind, Quality = {s : Str} ;
|
||||
|
||||
lin
|
||||
Is item quality = {s = item.s ++ "è" ++ quality.s} ;
|
||||
This kind = {s = "questo" ++ kind.s} ;
|
||||
That kind = {s = "quello" ++ kind.s} ;
|
||||
QKind quality kind = {s = kind.s ++ quality.s} ;
|
||||
Wine = {s = "vino"} ;
|
||||
Cheese = {s = "formaggio"} ;
|
||||
Fish = {s = "pesce"} ;
|
||||
Very quality = {s = "molto" ++ quality.s} ;
|
||||
Fresh = {s = "fresco"} ;
|
||||
Warm = {s = "caldo"} ;
|
||||
Italian = {s = "italiano"} ;
|
||||
Expensive = {s = "caro"} ;
|
||||
Delicious = {s = "delizioso"} ;
|
||||
Boring = {s = "noioso"} ;
|
||||
|
||||
}
|
||||
|
Before Width: | Height: | Size: 2.9 KiB |
@@ -1,6 +0,0 @@
|
||||
html:
|
||||
txt2tags -thtml --toc gf-tutorial2.txt
|
||||
tex:
|
||||
txt2tags -ttex --toc gf-tutorial2.txt
|
||||
pdflatex gf-tutorial2.tex
|
||||
pdflatex gf-tutorial2.tex
|
||||
@@ -1,10 +0,0 @@
|
||||
resource StringOper = {
|
||||
oper
|
||||
SS : Type = {s : Str} ;
|
||||
|
||||
ss : Str -> SS = \x -> {s = x} ;
|
||||
|
||||
cc : SS -> SS -> SS = \x,y -> ss (x.s ++ y.s) ;
|
||||
|
||||
prefix : Str -> SS -> SS = \p,x -> ss (p ++ x.s) ;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.7 KiB |
@@ -1,15 +0,0 @@
|
||||
Is. S ::= Item "is" Quality ;
|
||||
That. Item ::= "that" Kind ;
|
||||
This. Item ::= "this" Kind ;
|
||||
QKind. Kind ::= Quality Kind ;
|
||||
Cheese. Kind ::= "cheese" ;
|
||||
Fish. Kind ::= "fish" ;
|
||||
Wine. Kind ::= "wine" ;
|
||||
Italian. Quality ::= "Italian" ;
|
||||
Boring. Quality ::= "boring" ;
|
||||
Delicious. Quality ::= "delicious" ;
|
||||
Expensive. Quality ::= "expensive" ;
|
||||
Fresh. Quality ::= "fresh" ;
|
||||
Very. Quality ::= "very" Quality ;
|
||||
Warm. Quality ::= "warm" ;
|
||||
|
||||
@@ -1,489 +0,0 @@
|
||||
\chapter{The grammar of the GF language}
|
||||
|
||||
\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 GF}
|
||||
\subsection{Identifiers}
|
||||
Identifiers \nonterminal{Ident} are unquoted strings beginning with a letter,
|
||||
followed by any combination of letters, digits, and the characters {\tt \_ '},
|
||||
reserved words excluded.
|
||||
|
||||
|
||||
\subsection{Literals}
|
||||
Integer literals \nonterminal{Int}\ are nonempty sequences of digits.
|
||||
|
||||
|
||||
String literals \nonterminal{String}\ have the form
|
||||
\terminal{"}$x$\terminal{"}, where $x$ is any sequence of any characters
|
||||
except \terminal{"}\ unless preceded by \verb6\6.
|
||||
|
||||
|
||||
Double-precision float literals \nonterminal{Double}\ have the structure
|
||||
indicated by the regular expression $\nonterminal{digit}+ \mbox{{\it `.'}} \nonterminal{digit}+ (\mbox{{\it `e'}} \mbox{{\it `-'}}? \nonterminal{digit}+)?$ i.e.\
|
||||
two sequences of digits separated by a decimal point, optionally
|
||||
followed by an unsigned or negative exponent.
|
||||
|
||||
|
||||
|
||||
|
||||
\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 GF are the following: \\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\reserved{PType}} &{\reserved{Str}} &{\reserved{Strs}} \\
|
||||
{\reserved{Type}} &{\reserved{abstract}} &{\reserved{case}} \\
|
||||
{\reserved{cat}} &{\reserved{concrete}} &{\reserved{data}} \\
|
||||
{\reserved{def}} &{\reserved{flags}} &{\reserved{fun}} \\
|
||||
{\reserved{in}} &{\reserved{incomplete}} &{\reserved{instance}} \\
|
||||
{\reserved{interface}} &{\reserved{let}} &{\reserved{lin}} \\
|
||||
{\reserved{lincat}} &{\reserved{lindef}} &{\reserved{of}} \\
|
||||
{\reserved{open}} &{\reserved{oper}} &{\reserved{param}} \\
|
||||
{\reserved{pre}} &{\reserved{printname}} &{\reserved{resource}} \\
|
||||
{\reserved{strs}} &{\reserved{table}} &{\reserved{transfer}} \\
|
||||
{\reserved{variants}} &{\reserved{where}} &{\reserved{with}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
The symbols used in GF are the following: \\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\symb{;}} &{\symb{{$=$}}} &{\symb{:}} \\
|
||||
{\symb{{$-$}{$>$}}} &{\symb{\{}} &{\symb{\}}} \\
|
||||
{\symb{**}} &{\symb{,}} &{\symb{(}} \\
|
||||
{\symb{)}} &{\symb{[}} &{\symb{]}} \\
|
||||
{\symb{{$-$}}} &{\symb{.}} &{\symb{{$|$}}} \\
|
||||
{\symb{?}} &{\symb{{$<$}}} &{\symb{{$>$}}} \\
|
||||
{\symb{@}} &{\symb{!}} &{\symb{*}} \\
|
||||
{\symb{{$+$}}} &{\symb{{$+$}{$+$}}} &{\symb{$\backslash$}} \\
|
||||
{\symb{{$=$}{$>$}}} &{\symb{\_}} &{\symb{\$}} \\
|
||||
{\symb{/}} & & \\
|
||||
\end{tabular}\\
|
||||
|
||||
\subsection{Comments}
|
||||
Single-line comments begin with {\symb{{$-$}{$-$}}}. \\Multiple-line comments are enclosed with {\symb{\{{$-$}}} and {\symb{{$-$}\}}}.
|
||||
|
||||
\section{The syntactic structure of GF}
|
||||
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{Grammar}} & {\arrow} &{\nonterminal{ListModDef}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{ListModDef}} & {\arrow} &{\emptyP} \\
|
||||
& {\delimit} &{\nonterminal{ModDef}} {\nonterminal{ListModDef}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{ModDef}} & {\arrow} &{\nonterminal{ModDef}} {\terminal{;}} \\
|
||||
& {\delimit} &{\nonterminal{ComplMod}} {\nonterminal{ModType}} {\terminal{{$=$}}} {\nonterminal{ModBody}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{ModType}} & {\arrow} &{\terminal{abstract}} {\nonterminal{Ident}} \\
|
||||
& {\delimit} &{\terminal{resource}} {\nonterminal{Ident}} \\
|
||||
& {\delimit} &{\terminal{interface}} {\nonterminal{Ident}} \\
|
||||
& {\delimit} &{\terminal{concrete}} {\nonterminal{Ident}} {\terminal{of}} {\nonterminal{Ident}} \\
|
||||
& {\delimit} &{\terminal{instance}} {\nonterminal{Ident}} {\terminal{of}} {\nonterminal{Ident}} \\
|
||||
& {\delimit} &{\terminal{transfer}} {\nonterminal{Ident}} {\terminal{:}} {\nonterminal{Open}} {\terminal{{$-$}{$>$}}} {\nonterminal{Open}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{ModBody}} & {\arrow} &{\nonterminal{Extend}} {\nonterminal{Opens}} {\terminal{\{}} {\nonterminal{ListTopDef}} {\terminal{\}}} \\
|
||||
& {\delimit} &{\nonterminal{ListIncluded}} \\
|
||||
& {\delimit} &{\nonterminal{Included}} {\terminal{with}} {\nonterminal{ListOpen}} \\
|
||||
& {\delimit} &{\nonterminal{Included}} {\terminal{with}} {\nonterminal{ListOpen}} {\terminal{**}} {\nonterminal{Opens}} {\terminal{\{}} {\nonterminal{ListTopDef}} {\terminal{\}}} \\
|
||||
& {\delimit} &{\nonterminal{ListIncluded}} {\terminal{**}} {\nonterminal{Included}} {\terminal{with}} {\nonterminal{ListOpen}} \\
|
||||
& {\delimit} &{\nonterminal{ListIncluded}} {\terminal{**}} {\nonterminal{Included}} {\terminal{with}} {\nonterminal{ListOpen}} {\terminal{**}} {\nonterminal{Opens}} {\terminal{\{}} {\nonterminal{ListTopDef}} {\terminal{\}}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{ListTopDef}} & {\arrow} &{\emptyP} \\
|
||||
& {\delimit} &{\nonterminal{TopDef}} {\nonterminal{ListTopDef}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{Extend}} & {\arrow} &{\nonterminal{ListIncluded}} {\terminal{**}} \\
|
||||
& {\delimit} &{\emptyP} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{ListOpen}} & {\arrow} &{\emptyP} \\
|
||||
& {\delimit} &{\nonterminal{Open}} \\
|
||||
& {\delimit} &{\nonterminal{Open}} {\terminal{,}} {\nonterminal{ListOpen}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{Opens}} & {\arrow} &{\emptyP} \\
|
||||
& {\delimit} &{\terminal{open}} {\nonterminal{ListOpen}} {\terminal{in}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{Open}} & {\arrow} &{\nonterminal{Ident}} \\
|
||||
& {\delimit} &{\terminal{(}} {\nonterminal{QualOpen}} {\nonterminal{Ident}} {\terminal{)}} \\
|
||||
& {\delimit} &{\terminal{(}} {\nonterminal{QualOpen}} {\nonterminal{Ident}} {\terminal{{$=$}}} {\nonterminal{Ident}} {\terminal{)}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{ComplMod}} & {\arrow} &{\emptyP} \\
|
||||
& {\delimit} &{\terminal{incomplete}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{QualOpen}} & {\arrow} &{\emptyP} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{ListIncluded}} & {\arrow} &{\emptyP} \\
|
||||
& {\delimit} &{\nonterminal{Included}} \\
|
||||
& {\delimit} &{\nonterminal{Included}} {\terminal{,}} {\nonterminal{ListIncluded}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{Included}} & {\arrow} &{\nonterminal{Ident}} \\
|
||||
& {\delimit} &{\nonterminal{Ident}} {\terminal{[}} {\nonterminal{ListIdent}} {\terminal{]}} \\
|
||||
& {\delimit} &{\nonterminal{Ident}} {\terminal{{$-$}}} {\terminal{[}} {\nonterminal{ListIdent}} {\terminal{]}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{Def}} & {\arrow} &{\nonterminal{ListName}} {\terminal{:}} {\nonterminal{Exp}} \\
|
||||
& {\delimit} &{\nonterminal{ListName}} {\terminal{{$=$}}} {\nonterminal{Exp}} \\
|
||||
& {\delimit} &{\nonterminal{Name}} {\nonterminal{ListPatt}} {\terminal{{$=$}}} {\nonterminal{Exp}} \\
|
||||
& {\delimit} &{\nonterminal{ListName}} {\terminal{:}} {\nonterminal{Exp}} {\terminal{{$=$}}} {\nonterminal{Exp}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{TopDef}} & {\arrow} &{\terminal{cat}} {\nonterminal{ListCatDef}} \\
|
||||
& {\delimit} &{\terminal{fun}} {\nonterminal{ListFunDef}} \\
|
||||
& {\delimit} &{\terminal{data}} {\nonterminal{ListFunDef}} \\
|
||||
& {\delimit} &{\terminal{def}} {\nonterminal{ListDef}} \\
|
||||
& {\delimit} &{\terminal{data}} {\nonterminal{ListDataDef}} \\
|
||||
& {\delimit} &{\terminal{param}} {\nonterminal{ListParDef}} \\
|
||||
& {\delimit} &{\terminal{oper}} {\nonterminal{ListDef}} \\
|
||||
& {\delimit} &{\terminal{lincat}} {\nonterminal{ListPrintDef}} \\
|
||||
& {\delimit} &{\terminal{lindef}} {\nonterminal{ListDef}} \\
|
||||
& {\delimit} &{\terminal{lin}} {\nonterminal{ListDef}} \\
|
||||
& {\delimit} &{\terminal{printname}} {\terminal{cat}} {\nonterminal{ListPrintDef}} \\
|
||||
& {\delimit} &{\terminal{printname}} {\terminal{fun}} {\nonterminal{ListPrintDef}} \\
|
||||
& {\delimit} &{\terminal{flags}} {\nonterminal{ListFlagDef}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{CatDef}} & {\arrow} &{\nonterminal{Ident}} {\nonterminal{ListDDecl}} \\
|
||||
& {\delimit} &{\terminal{[}} {\nonterminal{Ident}} {\nonterminal{ListDDecl}} {\terminal{]}} \\
|
||||
& {\delimit} &{\terminal{[}} {\nonterminal{Ident}} {\nonterminal{ListDDecl}} {\terminal{]}} {\terminal{\{}} {\nonterminal{Integer}} {\terminal{\}}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{FunDef}} & {\arrow} &{\nonterminal{ListIdent}} {\terminal{:}} {\nonterminal{Exp}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{DataDef}} & {\arrow} &{\nonterminal{Ident}} {\terminal{{$=$}}} {\nonterminal{ListDataConstr}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{DataConstr}} & {\arrow} &{\nonterminal{Ident}} \\
|
||||
& {\delimit} &{\nonterminal{Ident}} {\terminal{.}} {\nonterminal{Ident}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{ListDataConstr}} & {\arrow} &{\emptyP} \\
|
||||
& {\delimit} &{\nonterminal{DataConstr}} \\
|
||||
& {\delimit} &{\nonterminal{DataConstr}} {\terminal{{$|$}}} {\nonterminal{ListDataConstr}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{ParDef}} & {\arrow} &{\nonterminal{Ident}} {\terminal{{$=$}}} {\nonterminal{ListParConstr}} \\
|
||||
& {\delimit} &{\nonterminal{Ident}} {\terminal{{$=$}}} {\terminal{(}} {\terminal{in}} {\nonterminal{Ident}} {\terminal{)}} \\
|
||||
& {\delimit} &{\nonterminal{Ident}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{ParConstr}} & {\arrow} &{\nonterminal{Ident}} {\nonterminal{ListDDecl}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{PrintDef}} & {\arrow} &{\nonterminal{ListName}} {\terminal{{$=$}}} {\nonterminal{Exp}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{FlagDef}} & {\arrow} &{\nonterminal{Ident}} {\terminal{{$=$}}} {\nonterminal{Ident}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{ListDef}} & {\arrow} &{\nonterminal{Def}} {\terminal{;}} \\
|
||||
& {\delimit} &{\nonterminal{Def}} {\terminal{;}} {\nonterminal{ListDef}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{ListCatDef}} & {\arrow} &{\nonterminal{CatDef}} {\terminal{;}} \\
|
||||
& {\delimit} &{\nonterminal{CatDef}} {\terminal{;}} {\nonterminal{ListCatDef}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{ListFunDef}} & {\arrow} &{\nonterminal{FunDef}} {\terminal{;}} \\
|
||||
& {\delimit} &{\nonterminal{FunDef}} {\terminal{;}} {\nonterminal{ListFunDef}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{ListDataDef}} & {\arrow} &{\nonterminal{DataDef}} {\terminal{;}} \\
|
||||
& {\delimit} &{\nonterminal{DataDef}} {\terminal{;}} {\nonterminal{ListDataDef}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{ListParDef}} & {\arrow} &{\nonterminal{ParDef}} {\terminal{;}} \\
|
||||
& {\delimit} &{\nonterminal{ParDef}} {\terminal{;}} {\nonterminal{ListParDef}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{ListPrintDef}} & {\arrow} &{\nonterminal{PrintDef}} {\terminal{;}} \\
|
||||
& {\delimit} &{\nonterminal{PrintDef}} {\terminal{;}} {\nonterminal{ListPrintDef}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{ListFlagDef}} & {\arrow} &{\nonterminal{FlagDef}} {\terminal{;}} \\
|
||||
& {\delimit} &{\nonterminal{FlagDef}} {\terminal{;}} {\nonterminal{ListFlagDef}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{ListParConstr}} & {\arrow} &{\emptyP} \\
|
||||
& {\delimit} &{\nonterminal{ParConstr}} \\
|
||||
& {\delimit} &{\nonterminal{ParConstr}} {\terminal{{$|$}}} {\nonterminal{ListParConstr}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{ListIdent}} & {\arrow} &{\nonterminal{Ident}} \\
|
||||
& {\delimit} &{\nonterminal{Ident}} {\terminal{,}} {\nonterminal{ListIdent}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{Name}} & {\arrow} &{\nonterminal{Ident}} \\
|
||||
& {\delimit} &{\terminal{[}} {\nonterminal{Ident}} {\terminal{]}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{ListName}} & {\arrow} &{\nonterminal{Name}} \\
|
||||
& {\delimit} &{\nonterminal{Name}} {\terminal{,}} {\nonterminal{ListName}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{LocDef}} & {\arrow} &{\nonterminal{ListIdent}} {\terminal{:}} {\nonterminal{Exp}} \\
|
||||
& {\delimit} &{\nonterminal{ListIdent}} {\terminal{{$=$}}} {\nonterminal{Exp}} \\
|
||||
& {\delimit} &{\nonterminal{ListIdent}} {\terminal{:}} {\nonterminal{Exp}} {\terminal{{$=$}}} {\nonterminal{Exp}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{ListLocDef}} & {\arrow} &{\emptyP} \\
|
||||
& {\delimit} &{\nonterminal{LocDef}} \\
|
||||
& {\delimit} &{\nonterminal{LocDef}} {\terminal{;}} {\nonterminal{ListLocDef}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{Exp6}} & {\arrow} &{\nonterminal{Ident}} \\
|
||||
& {\delimit} &{\nonterminal{Sort}} \\
|
||||
& {\delimit} &{\nonterminal{String}} \\
|
||||
& {\delimit} &{\nonterminal{Integer}} \\
|
||||
& {\delimit} &{\nonterminal{Double}} \\
|
||||
& {\delimit} &{\terminal{?}} \\
|
||||
& {\delimit} &{\terminal{[}} {\terminal{]}} \\
|
||||
& {\delimit} &{\terminal{data}} \\
|
||||
& {\delimit} &{\terminal{[}} {\nonterminal{Ident}} {\nonterminal{Exps}} {\terminal{]}} \\
|
||||
& {\delimit} &{\terminal{[}} {\nonterminal{String}} {\terminal{]}} \\
|
||||
& {\delimit} &{\terminal{\{}} {\nonterminal{ListLocDef}} {\terminal{\}}} \\
|
||||
& {\delimit} &{\terminal{{$<$}}} {\nonterminal{ListTupleComp}} {\terminal{{$>$}}} \\
|
||||
& {\delimit} &{\terminal{{$<$}}} {\nonterminal{Exp}} {\terminal{:}} {\nonterminal{Exp}} {\terminal{{$>$}}} \\
|
||||
& {\delimit} &{\terminal{(}} {\nonterminal{Exp}} {\terminal{)}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{Exp5}} & {\arrow} &{\nonterminal{Exp5}} {\terminal{.}} {\nonterminal{Label}} \\
|
||||
& {\delimit} &{\nonterminal{Exp6}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{Exp4}} & {\arrow} &{\nonterminal{Exp4}} {\nonterminal{Exp5}} \\
|
||||
& {\delimit} &{\terminal{table}} {\terminal{\{}} {\nonterminal{ListCase}} {\terminal{\}}} \\
|
||||
& {\delimit} &{\terminal{table}} {\nonterminal{Exp6}} {\terminal{\{}} {\nonterminal{ListCase}} {\terminal{\}}} \\
|
||||
& {\delimit} &{\terminal{table}} {\nonterminal{Exp6}} {\terminal{[}} {\nonterminal{ListExp}} {\terminal{]}} \\
|
||||
& {\delimit} &{\terminal{case}} {\nonterminal{Exp}} {\terminal{of}} {\terminal{\{}} {\nonterminal{ListCase}} {\terminal{\}}} \\
|
||||
& {\delimit} &{\terminal{variants}} {\terminal{\{}} {\nonterminal{ListExp}} {\terminal{\}}} \\
|
||||
& {\delimit} &{\terminal{pre}} {\terminal{\{}} {\nonterminal{Exp}} {\terminal{;}} {\nonterminal{ListAltern}} {\terminal{\}}} \\
|
||||
& {\delimit} &{\terminal{strs}} {\terminal{\{}} {\nonterminal{ListExp}} {\terminal{\}}} \\
|
||||
& {\delimit} &{\nonterminal{Ident}} {\terminal{@}} {\nonterminal{Exp6}} \\
|
||||
& {\delimit} &{\nonterminal{Exp5}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{Exp3}} & {\arrow} &{\nonterminal{Exp3}} {\terminal{!}} {\nonterminal{Exp4}} \\
|
||||
& {\delimit} &{\nonterminal{Exp3}} {\terminal{*}} {\nonterminal{Exp4}} \\
|
||||
& {\delimit} &{\nonterminal{Exp3}} {\terminal{**}} {\nonterminal{Exp4}} \\
|
||||
& {\delimit} &{\nonterminal{Exp4}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{Exp1}} & {\arrow} &{\nonterminal{Exp2}} {\terminal{{$+$}}} {\nonterminal{Exp1}} \\
|
||||
& {\delimit} &{\nonterminal{Exp2}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{Exp}} & {\arrow} &{\nonterminal{Exp1}} {\terminal{{$+$}{$+$}}} {\nonterminal{Exp}} \\
|
||||
& {\delimit} &{\terminal{$\backslash$}} {\nonterminal{ListBind}} {\terminal{{$-$}{$>$}}} {\nonterminal{Exp}} \\
|
||||
& {\delimit} &{\terminal{$\backslash$}} {\terminal{$\backslash$}} {\nonterminal{ListBind}} {\terminal{{$=$}{$>$}}} {\nonterminal{Exp}} \\
|
||||
& {\delimit} &{\nonterminal{Decl}} {\terminal{{$-$}{$>$}}} {\nonterminal{Exp}} \\
|
||||
& {\delimit} &{\nonterminal{Exp3}} {\terminal{{$=$}{$>$}}} {\nonterminal{Exp}} \\
|
||||
& {\delimit} &{\terminal{let}} {\terminal{\{}} {\nonterminal{ListLocDef}} {\terminal{\}}} {\terminal{in}} {\nonterminal{Exp}} \\
|
||||
& {\delimit} &{\terminal{let}} {\nonterminal{ListLocDef}} {\terminal{in}} {\nonterminal{Exp}} \\
|
||||
& {\delimit} &{\nonterminal{Exp3}} {\terminal{where}} {\terminal{\{}} {\nonterminal{ListLocDef}} {\terminal{\}}} \\
|
||||
& {\delimit} &{\terminal{in}} {\nonterminal{Exp5}} {\nonterminal{String}} \\
|
||||
& {\delimit} &{\nonterminal{Exp1}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{Exp2}} & {\arrow} &{\nonterminal{Exp3}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{ListExp}} & {\arrow} &{\emptyP} \\
|
||||
& {\delimit} &{\nonterminal{Exp}} \\
|
||||
& {\delimit} &{\nonterminal{Exp}} {\terminal{;}} {\nonterminal{ListExp}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{Exps}} & {\arrow} &{\emptyP} \\
|
||||
& {\delimit} &{\nonterminal{Exp6}} {\nonterminal{Exps}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{Patt2}} & {\arrow} &{\terminal{\_}} \\
|
||||
& {\delimit} &{\nonterminal{Ident}} \\
|
||||
& {\delimit} &{\nonterminal{Ident}} {\terminal{.}} {\nonterminal{Ident}} \\
|
||||
& {\delimit} &{\nonterminal{Integer}} \\
|
||||
& {\delimit} &{\nonterminal{Double}} \\
|
||||
& {\delimit} &{\nonterminal{String}} \\
|
||||
& {\delimit} &{\terminal{\{}} {\nonterminal{ListPattAss}} {\terminal{\}}} \\
|
||||
& {\delimit} &{\terminal{{$<$}}} {\nonterminal{ListPattTupleComp}} {\terminal{{$>$}}} \\
|
||||
& {\delimit} &{\terminal{(}} {\nonterminal{Patt}} {\terminal{)}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{Patt1}} & {\arrow} &{\nonterminal{Ident}} {\nonterminal{ListPatt}} \\
|
||||
& {\delimit} &{\nonterminal{Ident}} {\terminal{.}} {\nonterminal{Ident}} {\nonterminal{ListPatt}} \\
|
||||
& {\delimit} &{\nonterminal{Patt2}} {\terminal{*}} \\
|
||||
& {\delimit} &{\nonterminal{Ident}} {\terminal{@}} {\nonterminal{Patt2}} \\
|
||||
& {\delimit} &{\terminal{{$-$}}} {\nonterminal{Patt2}} \\
|
||||
& {\delimit} &{\nonterminal{Patt2}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{Patt}} & {\arrow} &{\nonterminal{Patt}} {\terminal{{$|$}}} {\nonterminal{Patt1}} \\
|
||||
& {\delimit} &{\nonterminal{Patt}} {\terminal{{$+$}}} {\nonterminal{Patt1}} \\
|
||||
& {\delimit} &{\nonterminal{Patt1}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{PattAss}} & {\arrow} &{\nonterminal{ListIdent}} {\terminal{{$=$}}} {\nonterminal{Patt}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{Label}} & {\arrow} &{\nonterminal{Ident}} \\
|
||||
& {\delimit} &{\terminal{\$}} {\nonterminal{Integer}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{Sort}} & {\arrow} &{\terminal{Type}} \\
|
||||
& {\delimit} &{\terminal{PType}} \\
|
||||
& {\delimit} &{\terminal{Str}} \\
|
||||
& {\delimit} &{\terminal{Strs}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{ListPattAss}} & {\arrow} &{\emptyP} \\
|
||||
& {\delimit} &{\nonterminal{PattAss}} \\
|
||||
& {\delimit} &{\nonterminal{PattAss}} {\terminal{;}} {\nonterminal{ListPattAss}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{ListPatt}} & {\arrow} &{\nonterminal{Patt2}} \\
|
||||
& {\delimit} &{\nonterminal{Patt2}} {\nonterminal{ListPatt}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{Bind}} & {\arrow} &{\nonterminal{Ident}} \\
|
||||
& {\delimit} &{\terminal{\_}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{ListBind}} & {\arrow} &{\emptyP} \\
|
||||
& {\delimit} &{\nonterminal{Bind}} \\
|
||||
& {\delimit} &{\nonterminal{Bind}} {\terminal{,}} {\nonterminal{ListBind}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{Decl}} & {\arrow} &{\terminal{(}} {\nonterminal{ListBind}} {\terminal{:}} {\nonterminal{Exp}} {\terminal{)}} \\
|
||||
& {\delimit} &{\nonterminal{Exp4}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{TupleComp}} & {\arrow} &{\nonterminal{Exp}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{PattTupleComp}} & {\arrow} &{\nonterminal{Patt}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{ListTupleComp}} & {\arrow} &{\emptyP} \\
|
||||
& {\delimit} &{\nonterminal{TupleComp}} \\
|
||||
& {\delimit} &{\nonterminal{TupleComp}} {\terminal{,}} {\nonterminal{ListTupleComp}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{ListPattTupleComp}} & {\arrow} &{\emptyP} \\
|
||||
& {\delimit} &{\nonterminal{PattTupleComp}} \\
|
||||
& {\delimit} &{\nonterminal{PattTupleComp}} {\terminal{,}} {\nonterminal{ListPattTupleComp}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{Case}} & {\arrow} &{\nonterminal{Patt}} {\terminal{{$=$}{$>$}}} {\nonterminal{Exp}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{ListCase}} & {\arrow} &{\nonterminal{Case}} \\
|
||||
& {\delimit} &{\nonterminal{Case}} {\terminal{;}} {\nonterminal{ListCase}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{Altern}} & {\arrow} &{\nonterminal{Exp}} {\terminal{/}} {\nonterminal{Exp}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{ListAltern}} & {\arrow} &{\emptyP} \\
|
||||
& {\delimit} &{\nonterminal{Altern}} \\
|
||||
& {\delimit} &{\nonterminal{Altern}} {\terminal{;}} {\nonterminal{ListAltern}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{DDecl}} & {\arrow} &{\terminal{(}} {\nonterminal{ListBind}} {\terminal{:}} {\nonterminal{Exp}} {\terminal{)}} \\
|
||||
& {\delimit} &{\nonterminal{Exp6}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
\begin{tabular}{lll}
|
||||
{\nonterminal{ListDDecl}} & {\arrow} &{\emptyP} \\
|
||||
& {\delimit} &{\nonterminal{DDecl}} {\nonterminal{ListDDecl}} \\
|
||||
\end{tabular}\\
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
\(
|
||||
(\forall p : \mbox{Pt})(\forall l : \mbox{Ln})(\mbox{Ext}(p,l) \; \supset \;
|
||||
(\exists m : \mbox{Ln})(\mbox{Inc}(p,m) \& \mbox{Par}(m,l)))
|
||||
\)
|
||||
@@ -1,23 +0,0 @@
|
||||
concrete Food2Eng of Food = open StringOper in {
|
||||
|
||||
lincat
|
||||
S, Item, Kind, Quality = SS ;
|
||||
|
||||
lin
|
||||
Is item quality = cc item (prefix "is" quality) ;
|
||||
This = prefix "this" ;
|
||||
That = prefix "that" ;
|
||||
QKind = cc ;
|
||||
Wine = ss "wine" ;
|
||||
Cheese = ss "cheese" ;
|
||||
Fish = ss "fish" ;
|
||||
Very = prefix "very" ;
|
||||
Fresh = ss "fresh" ;
|
||||
Warm = ss "warm" ;
|
||||
Italian = ss "Italian" ;
|
||||
Expensive = ss "expensive" ;
|
||||
Delicious = ss "delicious" ;
|
||||
Boring = ss "boring" ;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
abstract Foodmarket = Food, Fruit, Mushroom ** {
|
||||
fun
|
||||
FruitKind : Fruit -> Kind ;
|
||||
MushroomKind : Mushroom -> Kind ;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.3 KiB |
@@ -1,5 +0,0 @@
|
||||
concrete FoodmarketEng of Foodmarket = FoodEng, FruitEng, MushroomEng ** {
|
||||
lin
|
||||
FruitKind x = x ;
|
||||
MushroomKind x = x ;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
abstract Fruit = {
|
||||
cat Fruit ;
|
||||
fun Apple, Peach : Fruit ;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
concrete FruitEng of Fruit = {
|
||||
lin
|
||||
Apple = {s = "apple"} ;
|
||||
Peach = {s = "peach"} ;
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
all: book
|
||||
|
||||
tuthtml:
|
||||
txt2tags -thtml --toc gf-tutorial2_9.txt
|
||||
tuttex:
|
||||
txt2tags -ttex --toc gf-tutorial2_9.txt
|
||||
cat prelude gf-tutorial2_9.tex >tmp.tex
|
||||
mv tmp.tex gf-tutorial2_9.tex
|
||||
pdflatex gf-tutorial2_9.tex
|
||||
pdflatex gf-tutorial2_9.tex
|
||||
book:
|
||||
txt2tags -ttex --toc gf-book.txt
|
||||
cat prelude gf-book.tex >tmp.tex
|
||||
mv tmp.tex gf-book.tex
|
||||
pdflatex gf-book.tex
|
||||
pdflatex gf-book.tex
|
||||
@@ -1,8 +0,0 @@
|
||||
abstract Morefood = Food ** {
|
||||
cat
|
||||
Question ;
|
||||
fun
|
||||
QIs : Item -> Quality -> Question ;
|
||||
Pizza : Kind ;
|
||||
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
concrete MorefoodEng of Morefood = FoodEng ** {
|
||||
lincat
|
||||
Question = {s : Str} ;
|
||||
lin
|
||||
QIs item quality = {s = "is" ++ item.s ++ quality.s} ;
|
||||
Pizza = {s = "pizza"} ;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 14 KiB |
@@ -1,4 +0,0 @@
|
||||
abstract Mushroom = {
|
||||
cat Mushroom ;
|
||||
fun Cep, Agaric : Mushroom ;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
concrete MushroomEng of Mushroom = {
|
||||
lin
|
||||
Cep = {s = "cep"} ;
|
||||
Agaric = {s = "agaric"} ;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
|
||||
\setlength{\parskip}{0mm}
|
||||
\setlength{\parindent}{4mm}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
resource StringOper = {
|
||||
oper
|
||||
SS : Type = {s : Str} ;
|
||||
|
||||
ss : Str -> SS = \x -> {s = x} ;
|
||||
|
||||
cc : SS -> SS -> SS = \x,y -> ss (x.s ++ y.s) ;
|
||||
|
||||
prefix : Str -> SS -> SS = \p,x -> ss (p ++ x.s) ;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
@@ -1,12 +0,0 @@
|
||||
abstract Comments = {
|
||||
|
||||
cat
|
||||
S ; Item ; Kind ; Quality ;
|
||||
|
||||
fun
|
||||
Is : Item -> Quality -> S ;
|
||||
This, That, These, Those : Kind -> Item ;
|
||||
QKind : Quality -> Kind -> Kind ;
|
||||
Very : Quality -> Quality ;
|
||||
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
concrete CommentsEng of Comments = CommentsI with
|
||||
(Syntax = SyntaxEng) ;
|
||||
@@ -1,21 +0,0 @@
|
||||
--# -path=.:prelude
|
||||
|
||||
incomplete concrete CommentsI of Comments = open Syntax in {
|
||||
|
||||
lincat
|
||||
S = Syntax.S ;
|
||||
Quality = AP ;
|
||||
Kind = CN ;
|
||||
Item = NP ;
|
||||
|
||||
lin
|
||||
Is item quality = PosVP item (PredAP quality) ;
|
||||
This = DetCN this_Det ;
|
||||
That = DetCN that_Det ;
|
||||
These = DetCN these_Det ;
|
||||
Those = DetCN those_Det ;
|
||||
QKind = ModCN ;
|
||||
Very = AdAP very_AdA ;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
concrete CommentsIta of Comments = CommentsI with
|
||||
(Syntax = SyntaxIta) ;
|
||||
@@ -1,7 +0,0 @@
|
||||
abstract FoodComments = Comments ** {
|
||||
|
||||
fun
|
||||
Wine, Cheese, Fish, Pizza : Kind ;
|
||||
Fresh, Warm, Italian, Expensive, Delicious, Boring : Quality ;
|
||||
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
--# -path=.:../resource:prelude
|
||||
|
||||
|
||||
concrete FoodCommentsEng of FoodComments = CommentsEng ** open LexEng in {
|
||||
|
||||
lin
|
||||
Wine = regN "wine" ;
|
||||
Cheese = regN "cheese" ;
|
||||
Fish = mkN "fish" "fish" ;
|
||||
Pizza = regN "pizza" ;
|
||||
Fresh = mkA "fresh" ;
|
||||
Warm = mkA "warm" ;
|
||||
Italian = mkA "Italian" ;
|
||||
Expensive = mkA "expensive" ;
|
||||
Delicious = mkA "delicious" ;
|
||||
Boring = mkA "boring" ;
|
||||
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
--# -path=.:../resource:prelude
|
||||
|
||||
concrete FoodCommentsIta of FoodComments = CommentsIta ** open LexIta in {
|
||||
|
||||
lin
|
||||
Wine = regN "vino" ;
|
||||
Cheese = mkN masculine "formaggio" "formaggi" ;
|
||||
Fish = regN "pesce" ;
|
||||
Pizza = regN "pizza" ;
|
||||
Fresh = mkA "fresco" "fresca" "freschi" "fresche" ;
|
||||
Warm = regA "caldo" ;
|
||||
Italian = regA "italiano" ;
|
||||
Expensive = regA "caro" ;
|
||||
Delicious = regA "delizioso" ;
|
||||
Boring = regA "noioso" ;
|
||||
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
abstract Arithm = {
|
||||
|
||||
cat
|
||||
Prop ;
|
||||
Nat ;
|
||||
|
||||
fun
|
||||
Zero : Nat ;
|
||||
Succ : Nat -> Nat ;
|
||||
Even : Nat -> Prop ;
|
||||
And : Prop -> Prop -> Prop ;
|
||||
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
concrete ArithmEng of Arithm = ArithmI with
|
||||
(Lang = LangEng),
|
||||
(Lex = LexEng) ;
|
||||
|
||||
{-
|
||||
|
||||
concrete ArithmEng of Arithm = open LangEng, ParadigmsEng in {
|
||||
|
||||
lincat
|
||||
Prop = S ;
|
||||
Nat = NP ;
|
||||
|
||||
lin
|
||||
Zero =
|
||||
UsePN (regPN "zero" nonhuman) ;
|
||||
Succ n =
|
||||
DetCN (DetSg (SgQuant DefArt) NoOrd) (ComplN2 (regN2 "successor") n) ;
|
||||
Even n =
|
||||
UseCl TPres ASimul PPos
|
||||
(PredVP n (UseComp (CompAP (PositA (regA "even"))))) ;
|
||||
And x y =
|
||||
ConjS and_Conj (BaseS x y) ;
|
||||
|
||||
}
|
||||
-}
|
||||
@@ -1,20 +0,0 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
incomplete concrete ArithmI of Arithm = open Lang, Lex in {
|
||||
|
||||
lincat
|
||||
Prop = S ;
|
||||
Nat = NP ;
|
||||
|
||||
lin
|
||||
Zero =
|
||||
UsePN zero_PN ;
|
||||
Succ n =
|
||||
DetCN (DetSg (SgQuant DefArt) NoOrd) (ComplN2 successor_N2 n) ;
|
||||
Even n =
|
||||
UseCl TPres ASimul PPos
|
||||
(PredVP n (UseComp (CompAP (PositA even_A)))) ;
|
||||
And x y =
|
||||
ConjS and_Conj (BaseS x y) ;
|
||||
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
--# -path=.:alltenses:prelude
|
||||
|
||||
|
||||
concrete ArithmSwe of Arithm = ArithmI with
|
||||
(Lang = LangSwe),
|
||||
(Lex = LexSwe) ;
|
||||
|
||||
{-
|
||||
concrete ArithmSwe of Arithm = open LangSwe, ParadigmsSwe in {
|
||||
|
||||
lincat
|
||||
Prop = S ;
|
||||
Nat = NP ;
|
||||
|
||||
lin
|
||||
Zero =
|
||||
UsePN (regPN "noll" neutrum) ;
|
||||
Succ n =
|
||||
DetCN (DetSg (SgQuant DefArt) NoOrd)
|
||||
(ComplN2 (mkN2 (mk2N "efterföljare" "efterföljare")
|
||||
(mkPreposition "till")) n) ;
|
||||
Even n =
|
||||
UseCl TPres ASimul PPos
|
||||
(PredVP n (UseComp (CompAP (PositA (regA "jämn"))))) ;
|
||||
And x y =
|
||||
ConjS and_Conj (BaseS x y) ;
|
||||
|
||||
}
|
||||
-}
|
||||
@@ -1,6 +0,0 @@
|
||||
abstract Lex = Cat ** {
|
||||
fun
|
||||
zero_PN : PN ;
|
||||
successor_N2 : N2 ;
|
||||
even_A : A ;
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
concrete LexEng of Lex = CatEng ** open ParadigmsEng in {
|
||||
lin
|
||||
zero_PN = regPN "zero" nonhuman ;
|
||||
successor_N2 = regN2 "successor" ;
|
||||
even_A = regA "even" ;
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
concrete LexSwe of Lex = CatSwe ** open ParadigmsSwe in {
|
||||
lin
|
||||
zero_PN = regPN "noll" neutrum ;
|
||||
successor_N2 =
|
||||
mkN2 (mk2N "efterföljare" "efterföljare") (mkPreposition "till") ;
|
||||
even_A = regA "jämn" ;
|
||||
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
Is. S ::= Item "is" Quality ;
|
||||
That. Item ::= "that" Kind ;
|
||||
This. Item ::= "this" Kind ;
|
||||
QKind. Kind ::= Quality Kind ;
|
||||
Cheese. Kind ::= "cheese" ;
|
||||
Fish. Kind ::= "fish" ;
|
||||
Wine. Kind ::= "wine" ;
|
||||
Italian. Quality ::= "Italian" ;
|
||||
Boring. Quality ::= "boring" ;
|
||||
Delicious. Quality ::= "delicious" ;
|
||||
Expensive. Quality ::= "expensive" ;
|
||||
Fresh. Quality ::= "fresh" ;
|
||||
Very. Quality ::= "very" Quality ;
|
||||
Warm. Quality ::= "warm" ;
|
||||
|
||||
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 31 KiB |
@@ -1,12 +0,0 @@
|
||||
abstract Music = {
|
||||
|
||||
flags startcat=Kind ;
|
||||
|
||||
cat
|
||||
Kind ;
|
||||
Property ;
|
||||
fun
|
||||
PropKind : Kind -> Property -> Kind ;
|
||||
Song : Kind ;
|
||||
American : Property ;
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
--# -path=.:present:api:prelude
|
||||
|
||||
concrete MusicEng of Music =
|
||||
MusicI - [PropKind]
|
||||
with
|
||||
(Syntax = SyntaxEng),
|
||||
(MusicLex = MusicLexEng) **
|
||||
open SyntaxEng in {
|
||||
lin
|
||||
PropKind k p = mkCN k (mkRS (mkRCl which_RP (mkVP p))) ;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
--# -path=.:present:prelude
|
||||
|
||||
concrete MusicFin of Music = MusicI with
|
||||
(Syntax = SyntaxFin),
|
||||
(MusicLex = MusicLexFin) ;
|
||||
@@ -1,6 +0,0 @@
|
||||
--# -path=.:present:prelude
|
||||
|
||||
|
||||
concrete MusicFre of Music = MusicI with
|
||||
(Syntax = SyntaxFre),
|
||||
(MusicLex = MusicLexFre) ;
|
||||
@@ -1,6 +0,0 @@
|
||||
--# -path=.:present:api:prelude
|
||||
|
||||
concrete MusicGer of Music = MusicI with
|
||||
(Syntax = SyntaxGer),
|
||||
(MusicLex = MusicLexGer) ;
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
incomplete concrete MusicI of Music = open Syntax, MusicLex in {
|
||||
lincat
|
||||
Kind = CN ;
|
||||
Property = AP ;
|
||||
lin
|
||||
PropKind k p = mkCN p k ;
|
||||
Song = mkCN song_N ;
|
||||
American = mkAP american_A ;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
abstract MusicLex = Cat ** {
|
||||
fun
|
||||
song_N : N ;
|
||||
american_A : A ;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
concrete MusicLexEng of MusicLex = CatEng ** open ParadigmsEng in {
|
||||
lin
|
||||
song_N = mkN "song" "songs" ;
|
||||
american_A = mkA "American" ;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
concrete MusicLexFin of MusicLex =
|
||||
CatFin ** open ParadigmsFin in {
|
||||
lin
|
||||
song_N = mkN "kappale" ;
|
||||
american_A = mkA "amerikkalainen" ;
|
||||
}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
concrete MusicLexFre of MusicLex = CatFre ** open ParadigmsFre in {
|
||||
|
||||
lin
|
||||
song_N = mkN "chanson" feminine ;
|
||||
american_A = mkA "américain" ;
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
concrete MusicLexGer of MusicLex =
|
||||
CatGer ** open ParadigmsGer in {
|
||||
lin
|
||||
song_N = mkN "Lied" "Lieder" neuter ;
|
||||
american_A = mkA "amerikanisch" ;
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
abstract Music = {
|
||||
cat
|
||||
Kind ;
|
||||
Property ;
|
||||
fun
|
||||
PropKind : Kind -> Property -> Kind ;
|
||||
Song : Kind ;
|
||||
American : Property ;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
--# -path=.:present:prelude
|
||||
|
||||
concrete MusicEng of Music = MusicEng0 - [PropKind] ** open GrammarEng in {
|
||||
lin
|
||||
PropKind k p =
|
||||
RelCN k (UseRCl TPres ASimul PPos (RelVP IdRP (UseComp (CompAP p)))) ;
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
concrete MusicEng0 of Music = MusicI with
|
||||
(Grammar = GrammarEng),
|
||||
(MusicLex = MusicLexEng) ;
|
||||
@@ -1,5 +0,0 @@
|
||||
--# -path=.:present:prelude
|
||||
|
||||
concrete MusicFin of Music = MusicI with
|
||||
(Grammar = GrammarFin),
|
||||
(MusicLex = MusicLexFin) ;
|
||||
@@ -1,6 +0,0 @@
|
||||
--# -path=.:present:prelude
|
||||
|
||||
|
||||
concrete MusicFre of Music = MusicI with
|
||||
(Grammar = GrammarFre),
|
||||
(MusicLex = MusicLexFre) ;
|
||||
@@ -1,6 +0,0 @@
|
||||
--# -path=.:present:prelude
|
||||
|
||||
concrete MusicGer of Music = MusicI with
|
||||
(Grammar = GrammarGer),
|
||||
(MusicLex = MusicLexGer) ;
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
incomplete concrete MusicI of Music = open Grammar, MusicLex in {
|
||||
lincat
|
||||
Kind = CN ;
|
||||
Property = AP ;
|
||||
lin
|
||||
PropKind k p = AdjCN p k ;
|
||||
Song = UseN song_N ;
|
||||
American = PositA american_A ;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
abstract MusicLex = Cat ** {
|
||||
fun
|
||||
song_N : N ;
|
||||
american_A : A ;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
concrete MusicLexEng of MusicLex = CatEng ** open ParadigmsEng in {
|
||||
lin
|
||||
song_N = regN "song" ;
|
||||
american_A = regA "American" ;
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
concrete MusicLexFin of MusicLex = CatFin ** open ParadigmsFin in {
|
||||
lin
|
||||
song_N = regN "kappale" ;
|
||||
american_A = regA "amerikkalainen" ;
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
concrete MusicLexFre of MusicLex = CatFre ** open ParadigmsFre in {
|
||||
lin
|
||||
song_N = regGenN "chanson" feminine ;
|
||||
american_A = regA "américain" ;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
concrete MusicLexGer of MusicLex = CatGer ** open ParadigmsGer in {
|
||||
lin
|
||||
song_N = reg2N "Lied" "Lieder" neuter ;
|
||||
american_A = regA "amerikanisch" ;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
abstract Fish = {
|
||||
cat Fish ;
|
||||
fun Salmon, Perch : Fish ;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
concrete FishEng of Fish = {
|
||||
lin
|
||||
Salmon = {s = "salmon"} ;
|
||||
Perch = {s = "perch"} ;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
abstract Gatherer = Paleolithic, Fish, Mushrooms ** {
|
||||
fun
|
||||
FishCN : Fish -> CN ;
|
||||
MushroomCN : Mushroom -> CN ;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 12 KiB |
@@ -1,5 +0,0 @@
|
||||
concrete GathererEng of Gatherer = PaleolithicEng, FishEng, MushroomsEng ** {
|
||||
lin
|
||||
UseFish x = x ;
|
||||
UseMushroom x = x ;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
abstract Mushrooms = {
|
||||
cat Mushroom ;
|
||||
fun Cep, Agaric : Mushroom ;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
concrete MushroomsEng of Mushrooms = {
|
||||
lin
|
||||
Cep = {s = "cep"} ;
|
||||
Agaric = {s = "agaric"} ;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
abstract Neolithic = Paleolithic ** {
|
||||
fun
|
||||
Fire, Wheel : CN ;
|
||||
Think : V ;
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
concrete NeolithicEng of Neolithic = PaleolithicEng ** {
|
||||
lin
|
||||
Fire = {s = "fire"} ;
|
||||
Wheel = {s = "wheel"} ;
|
||||
Think = {s = "thinks"} ;
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
abstract Paleolithic = {
|
||||
cat
|
||||
S ; NP ; VP ; CN ; A ; V ; TV ;
|
||||
|
||||
fun
|
||||
PredVP : NP -> VP -> S ;
|
||||
UseV : V -> VP ;
|
||||
ComplTV : TV -> NP -> VP ;
|
||||
UseA : A -> VP ;
|
||||
ModA : A -> CN -> CN ;
|
||||
This, That, Def, Indef : CN -> NP ;
|
||||
Boy, Louse, Snake, Worm : CN ;
|
||||
Green, Rotten, Thick, Warm : A ;
|
||||
Laugh, Sleep, Swim : V ;
|
||||
Eat, Kill, Wash : TV ;
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
concrete PaleolithicEng of Paleolithic = {
|
||||
lincat
|
||||
S, NP, VP, CN, A, V, TV = {s : Str} ;
|
||||
lin
|
||||
PredVP np vp = {s = np.s ++ vp.s} ;
|
||||
UseV v = v ;
|
||||
ComplTV tv np = {s = tv.s ++ np.s} ;
|
||||
UseA a = {s = "is" ++ a.s} ;
|
||||
This cn = {s = "this" ++ cn.s} ;
|
||||
That cn = {s = "that" ++ cn.s} ;
|
||||
Def cn = {s = "the" ++ cn.s} ;
|
||||
Indef cn = {s = "a" ++ cn.s} ;
|
||||
ModA a cn = {s = a.s ++ cn.s} ;
|
||||
Boy = {s = "boy"} ;
|
||||
Louse = {s = "louse"} ;
|
||||
Snake = {s = "snake"} ;
|
||||
Worm = {s = "worm"} ;
|
||||
Green = {s = "green"} ;
|
||||
Rotten = {s = "rotten"} ;
|
||||
Thick = {s = "thick"} ;
|
||||
Warm = {s = "warm"} ;
|
||||
Laugh = {s = "laughs"} ;
|
||||
Sleep = {s = "sleeps"} ;
|
||||
Swim = {s = "swims"} ;
|
||||
Eat = {s = "eats"} ;
|
||||
Kill = {s = "kills"} ;
|
||||
Wash = {s = "washes"} ;
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
concrete PaleolithicIta of Paleolithic = {
|
||||
lincat
|
||||
S, NP, VP, CN, A, V, TV = {s : Str} ;
|
||||
lin
|
||||
PredVP np vp = {s = np.s ++ vp.s} ;
|
||||
UseV v = v ;
|
||||
ComplTV tv np = {s = tv.s ++ np.s} ;
|
||||
UseA a = {s = "è" ++ a.s} ;
|
||||
This cn = {s = "questo" ++ cn.s} ;
|
||||
That cn = {s = "quello" ++ cn.s} ;
|
||||
Def cn = {s = "il" ++ cn.s} ;
|
||||
Indef cn = {s = "un" ++ cn.s} ;
|
||||
ModA a cn = {s = cn.s ++ a.s} ;
|
||||
Boy = {s = "ragazzo"} ;
|
||||
Louse = {s = "pidocchio"} ;
|
||||
Snake = {s = "serpente"} ;
|
||||
Worm = {s = "verme"} ;
|
||||
Green = {s = "verde"} ;
|
||||
Rotten = {s = "marcio"} ;
|
||||
Thick = {s = "grosso"} ;
|
||||
Warm = {s = "caldo"} ;
|
||||
Laugh = {s = "ride"} ;
|
||||
Sleep = {s = "dorme"} ;
|
||||
Swim = {s = "nuota"} ;
|
||||
Eat = {s = "mangia"} ;
|
||||
Kill = {s = "uccide"} ;
|
||||
Wash = {s = "lava"} ;
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
PredVP. S ::= NP VP ;
|
||||
UseV. VP ::= V ;
|
||||
ComplTV. VP ::= TV NP ;
|
||||
UseA. VP ::= "is" A ;
|
||||
This. NP ::= "this" CN ;
|
||||
That. NP ::= "that" CN ;
|
||||
Def. NP ::= "the" CN ;
|
||||
Indef. NP ::= "a" CN ;
|
||||
ModA. CN ::= A CN ;
|
||||
Boy. CN ::= "boy" ;
|
||||
Louse. CN ::= "louse" ;
|
||||
Snake. CN ::= "snake" ;
|
||||
Worm. CN ::= "worm" ;
|
||||
Green. A ::= "green" ;
|
||||
Rotten. A ::= "rotten" ;
|
||||
Thick. A ::= "thick" ;
|
||||
Warm. A ::= "warm" ;
|
||||
Laugh. V ::= "laughs" ;
|
||||
Sleep. V ::= "sleeps" ;
|
||||
Swim. V ::= "swims" ;
|
||||
Eat. TV ::= "eats" ;
|
||||
Kill. TV ::= "kills"
|
||||
Wash. TV ::= "washes" ;
|
||||
@@ -1,8 +0,0 @@
|
||||
S ::= NP VP ;
|
||||
VP ::= V | TV NP | "is" A ;
|
||||
NP ::= ("this" | "that" | "the" | "a") CN ;
|
||||
CN ::= A CN ;
|
||||
CN ::= "boy" | "louse" | "snake" | "worm" ;
|
||||
A ::= "green" | "rotten" | "thick" | "warm" ;
|
||||
V ::= "laughs" | "sleeps" | "swims" ;
|
||||
TV ::= "eats" | "kills" | "washes" ;
|
||||
@@ -1,12 +0,0 @@
|
||||
\documentclass[nwbk_0pt]{book}
|
||||
\usepackage[latin1]{inputenc}
|
||||
|
||||
%\setlength{\oddsidemargin}{0mm}
|
||||
%\setlength{\evensidemargin}{-2mm}
|
||||
%\setlength{\topmargin}{-12mm}
|
||||
%\setlength{\textheight}{220mm}
|
||||
%\setlength{\textwidth}{158mm}
|
||||
|
||||
\newcommand{\bequ}{\begin{quote}}
|
||||
\newcommand{\enqu}{\end{quote}}
|
||||
%%%
|
||||
@@ -1,14 +0,0 @@
|
||||
abstract Food = {
|
||||
|
||||
cat
|
||||
S ; Item ; Kind ; Quality ;
|
||||
|
||||
fun
|
||||
Is : Item -> Quality -> S ;
|
||||
This, That, All : Kind -> Item ;
|
||||
QKind : Quality -> Kind -> Kind ;
|
||||
Wine, Cheese, Fish, Beer, Pizza : Kind ;
|
||||
Very : Quality -> Quality ;
|
||||
Fresh, Warm, Italian, Expensive, Delicious, Boring : Quality ;
|
||||
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
--# -path=.:present:prelude
|
||||
|
||||
concrete FoodEng of Food = FoodI - [Pizza] with
|
||||
(Syntax = SyntaxEng),
|
||||
(LexFood = LexFoodEng) **
|
||||
open SyntaxEng, ParadigmsEng in {
|
||||
|
||||
lin Pizza = mkCN (mkA "Italian") (mkN "pie") ;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
--# -path=.:present:prelude
|
||||
|
||||
concrete FoodFin of Food = FoodI with
|
||||
(Syntax = SyntaxFin),
|
||||
(LexFood = LexFoodFin) ;
|
||||
@@ -1,30 +0,0 @@
|
||||
--# -path=present:prelude
|
||||
|
||||
concrete FoodFre of Food = open SyntaxFre,ParadigmsFre in {
|
||||
|
||||
lincat
|
||||
S = Utt ;
|
||||
Item = NP ;
|
||||
Kind = CN ;
|
||||
Quality = AP ;
|
||||
|
||||
lin
|
||||
Is item quality = mkUtt (mkCl item quality) ;
|
||||
This kind = mkNP (mkDet this_Quant) kind ;
|
||||
That kind = mkNP (mkDet that_Quant) kind ;
|
||||
All kind = mkNP all_Predet (mkNP defPlDet kind) ;
|
||||
QKind quality kind = mkCN quality kind ;
|
||||
Wine = mkCN (mkN "vin") ;
|
||||
Beer = mkCN (mkN "bière") ;
|
||||
Pizza = mkCN (mkN "pizza" feminine) ;
|
||||
Cheese = mkCN (mkN "fromage" masculine) ;
|
||||
Fish = mkCN (mkN "poisson") ;
|
||||
Very quality = mkAP very_AdA quality ;
|
||||
Fresh = mkAP (mkA "frais" "fraîche") ;
|
||||
Warm = mkAP (mkA "chaud") ;
|
||||
Italian = mkAP (mkA "italien") ;
|
||||
Expensive = mkAP (mkA "cher") ;
|
||||
Delicious = mkAP (mkA "délicieux") ;
|
||||
Boring = mkAP (mkA "ennuyeux") ;
|
||||
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
--# -path=.:present:prelude
|
||||
|
||||
concrete FoodGer of Food = FoodI with
|
||||
(Syntax = SyntaxGer),
|
||||
(LexFood = LexFoodGer) ;
|
||||
@@ -1,28 +0,0 @@
|
||||
incomplete concrete FoodI of Food = open Syntax, LexFood in {
|
||||
|
||||
lincat
|
||||
S = Utt ;
|
||||
Item = NP ;
|
||||
Kind = CN ;
|
||||
Quality = AP ;
|
||||
|
||||
lin
|
||||
Is item quality = mkUtt (mkCl item quality) ;
|
||||
This kind = mkNP (mkDet this_Quant) kind ;
|
||||
That kind = mkNP (mkDet that_Quant) kind ;
|
||||
All kind = mkNP all_Predet (mkNP defPlDet kind) ;
|
||||
QKind quality kind = mkCN quality kind ;
|
||||
Wine = mkCN wine_N ;
|
||||
Beer = mkCN beer_N ;
|
||||
Pizza = mkCN pizza_N ;
|
||||
Cheese = mkCN cheese_N ;
|
||||
Fish = mkCN fish_N ;
|
||||
Very quality = mkAP very_AdA quality ;
|
||||
Fresh = mkAP fresh_A ;
|
||||
Warm = mkAP warm_A ;
|
||||
Italian = mkAP italian_A ;
|
||||
Expensive = mkAP expensive_A ;
|
||||
Delicious = mkAP delicious_A ;
|
||||
Boring = mkAP boring_A ;
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
interface LexFood = open Syntax in {
|
||||
|
||||
oper
|
||||
wine_N : N ;
|
||||
beer_N : N ;
|
||||
pizza_N : N ;
|
||||
cheese_N : N ;
|
||||
fish_N : N ;
|
||||
fresh_A : A ;
|
||||
warm_A : A ;
|
||||
italian_A : A ;
|
||||
expensive_A : A ;
|
||||
delicious_A : A ;
|
||||
boring_A : A ;
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
instance LexFoodFin of LexFood = open SyntaxFin, ParadigmsFin in {
|
||||
|
||||
oper
|
||||
wine_N = mkN "viini" ;
|
||||
beer_N = mkN "olut" ;
|
||||
pizza_N = mkN "pizza" ;
|
||||
cheese_N = mkN "juusto" ;
|
||||
fish_N = mkN "kala" ;
|
||||
fresh_A = mkA "tuore" ;
|
||||
warm_A = mkA "lämmin" ;
|
||||
italian_A = mkA "italialainen" ;
|
||||
expensive_A = mkA "kallis" ;
|
||||
delicious_A = mkA "herkullinen" ;
|
||||
boring_A = mkA "tylsä" ;
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
instance LexFoodGer of LexFood = open SyntaxGer, ParadigmsGer in {
|
||||
|
||||
oper
|
||||
wine_N = mkN "Wein" ;
|
||||
beer_N = mkN "Bier" "Biere" neuter ;
|
||||
pizza_N = mkN "Pizza" "Pizzen" feminine ;
|
||||
cheese_N = mkN "Käse" "Käsen" masculine ;
|
||||
fish_N = mkN "Fisch" ;
|
||||
fresh_A = mkA "frisch" ;
|
||||
warm_A = mkA "warm" "wärmer" "wärmste" ;
|
||||
italian_A = mkA "italienisch" ;
|
||||
expensive_A = mkA "teuer" ;
|
||||
delicious_A = mkA "köstlich" ;
|
||||
boring_A = mkA "langweilig" ;
|
||||
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
--# -path=.:prelude
|
||||
|
||||
resource LexEng = open SyntaxEng, MorphoEng, Prelude in {
|
||||
|
||||
oper
|
||||
|
||||
-- constructors for open lexicon
|
||||
|
||||
mkN : (man,men : Str) -> CN ;
|
||||
regN : (car : Str) -> CN ;
|
||||
|
||||
mkA : (hot : Str) -> AP ;
|
||||
|
||||
mkV : (go,goes : Str) -> V ;
|
||||
regV : (walk : Str) -> V ;
|
||||
|
||||
mkV2 : (look : V) -> (at : Str) -> V2 ;
|
||||
dirV2 : (eat : V) -> V2 ;
|
||||
|
||||
--------------------------------------------
|
||||
-- definitions, hidden from users
|
||||
|
||||
mkN x y = mkNoun x y ** {lock_CN = <>} ;
|
||||
regN x = regNoun x ** {lock_CN = <>} ;
|
||||
|
||||
mkA x = ss x ** {lock_AP = <>} ;
|
||||
|
||||
mkV x y = mkVerb x y ** {lock_V = <>} ;
|
||||
regV x = regVerb x ** {lock_V = <>} ;
|
||||
|
||||
mkV2 x p = x ** {c = p ; lock_V2 = <>} ;
|
||||
dirV2 x = mkV2 x [] ;
|
||||
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
interface LexFoods = open Syntax in {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
--# -path=.:prelude
|
||||
|
||||
resource LexIta = open SyntaxIta, MorphoIta, Prelude in {
|
||||
|
||||
oper
|
||||
|
||||
-- constructors for genders
|
||||
|
||||
Gender : Type ;
|
||||
masculine, feminine : Gender ;
|
||||
|
||||
-- constructors for open lexicon
|
||||
|
||||
mkN : Gender -> (vino,vini : Str) -> CN ;
|
||||
regN : (vino : Str) -> CN ;
|
||||
femN : CN -> CN ;
|
||||
|
||||
mkA : (nero,nera,neri,nere : Str) -> AP ;
|
||||
regA : (nero : Str) -> AP ;
|
||||
|
||||
mkV : (ama,amano : Str) -> V ;
|
||||
regV : (amare : Str) -> V ;
|
||||
|
||||
mkV2 : (aspettare : V) -> (a : Str) -> V2 ;
|
||||
dirV2 : (mangiare : V) -> V2 ;
|
||||
|
||||
--------------------------------------------
|
||||
-- definitions, hidden from users
|
||||
|
||||
Gender = MorphoIta.Gender ;
|
||||
masculine = Masc ;
|
||||
feminine = Fem ;
|
||||
|
||||
mkN g x y = mkNoun g x y ** {lock_CN = <>} ;
|
||||
regN x = regNoun x ** {lock_CN = <>} ;
|
||||
|
||||
mkA x y z u = mkAdjective x y z u ** {lock_AP = <>} ;
|
||||
regA x = regAdjective x ** {lock_AP = <>} ;
|
||||
|
||||
mkV x y = mkVerb x y ** {lock_V = <>} ;
|
||||
regV x = regVerb x ** {lock_V = <>} ;
|
||||
|
||||
mkV2 x p = x ** {c = p ; lock_V2 = <>} ;
|
||||
dirV2 x = mkV2 x [] ;
|
||||
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
abstract Smart = {
|
||||
|
||||
flags startcat = Command ;
|
||||
|
||||
cat
|
||||
Command ;
|
||||
Kind ;
|
||||
Action Kind ;
|
||||
Device Kind ;
|
||||
fun
|
||||
CAction : (k : Kind) -> Action k -> Device k -> Command ;
|
||||
DKindOne : (k : Kind) -> Device k ;
|
||||
light, fan : Kind ;
|
||||
switchOn, switchOff : (k : Kind) -> Action k ;
|
||||
dim : Action light ;
|
||||
}
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
--# -path=.:prelude
|
||||
|
||||
concrete SmartEng of Smart = open Prelude in {
|
||||
|
||||
-- part of grammar Toy1 from the Regulus book
|
||||
|
||||
lincat
|
||||
Command, Kind, Action, Device = SS ;
|
||||
lin
|
||||
CAction _ act dev = ss (act.s ++ dev.s) ;
|
||||
DKindOne k = ss ("the" ++ k.s) ;
|
||||
|
||||
light = ss "light" ;
|
||||
fan = ss "fan" ;
|
||||
switchOn _ = ss ["switch on"] ;
|
||||
switchOff _ = ss ["switch off"] ;
|
||||
dim = ss "dim" ;
|
||||
}
|
||||
|
||||