1
0
forked from GitHub/gf-core

started a subdir for the book

This commit is contained in:
aarne
2010-11-22 12:55:37 +00:00
parent 8ab5ec00c6
commit 46137ab6a6
97 changed files with 2026 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
concrete Copy of CopyAbs = {
lincat S, AB = Str ;
lin s x = x ++ x ;
end = [] ;
a x = "a" ++ x ;
b x = "b" ++ x ;
}

View File

@@ -0,0 +1,6 @@
abstract CopyAbs = {
cat S ; AB ;
fun s : AB -> S ;
end : AB ;
a,b : AB -> AB ;
}

View File

@@ -0,0 +1,13 @@
abstract Food = {
flags startcat = Comment ;
cat
Comment ; Item ; Kind ; Quality ;
fun
Pred : Item -> Quality -> Comment ;
This, That : Kind -> Item ;
Mod : Quality -> Kind -> Kind ;
Wine, Cheese, Fish : Kind ;
Very : Quality -> Quality ;
Fresh, Warm, Italian,
Expensive, Delicious, Boring : Quality ;
}

View File

@@ -0,0 +1,19 @@
concrete FoodEng of Food = {
lincat
Comment, Item, Kind, Quality = Str ;
lin
Pred item quality = item ++ "is" ++ quality ;
This kind = "this" ++ kind ;
That kind = "that" ++ kind ;
Mod quality kind = quality ++ kind ;
Wine = "wine" ;
Cheese = "cheese" ;
Fish = "fish" ;
Very quality = "very" ++ quality ;
Fresh = "fresh" ;
Warm = "warm" ;
Italian = "Italian" ;
Expensive = "expensive" ;
Delicious = "delicious" ;
Boring = "boring" ;
}

View File

@@ -0,0 +1,24 @@
concrete FoodHin of Food = {
flags coding = utf8 ;
lincat Comment, Item, Kind, Quality = Str ;
lin
Pred item quality = item ++ quality ++ "है" ;
This kind = "यह" ++ kind ;
That kind = "वह" ++ kind ;
Mod quality kind = quality ++ kind ;
Wine = "मदिरा" ;
Cheese = "पनीर" ;
Fish = "मछली" ;
Very quality = "अति" ++ quality ;
Fresh = "ताज़ा" ;
Warm = "गरम" ;
Italian = "इटली" ;
Expensive = "बहुमूल्य" ;
Delicious = "स्वादिष्ट" ;
Boring = "अरुचिकर" ;
}

View File

@@ -0,0 +1,19 @@
concrete FoodIta of Food = {
lincat
Comment, Item, Kind, Quality = Str ;
lin
Pred item quality = item ++ "è" ++ quality ;
This kind = "questo" ++ kind ;
That kind = "quel" ++ kind ;
Mod quality kind = kind ++ quality ;
Wine = "vino" ;
Cheese = "formaggio" ;
Fish = "pesce" ;
Very quality = "molto" ++ quality ;
Fresh = "fresco" ;
Warm = "caldo" ;
Italian = "italiano" ;
Expensive = "caro" ;
Delicious = "delizioso" ;
Boring = "noioso" ;
}

View File

@@ -0,0 +1,8 @@
abstract Letters = {
cat L ;
fun
a, b, c, d, e, f, g, h, i, j, k, l, m,
n, o, p, q, r, s, t, u, v, w, x, y, z : L ;
}

View File

@@ -0,0 +1,31 @@
concrete LettersCnc of Letters = {
lincat L = Str ;
lin
a = "a" ;
b = "b" ;
c = "c" ;
d = "d" ;
e = "e" ;
f = "f" ;
g = "g" ;
h = "h" ;
i = "i" ;
j = "j" ;
k = "k" ;
l = "l" ;
m = "m" ;
n = "n" ;
o = "o" ;
p = "p" ;
q = "q" ;
r = "r" ;
s = "s" ;
t = "t" ;
u = "u" ;
v = "v" ;
w = "w" ;
x = "x" ;
y = "y" ;
z = "z" ;
}

View File

@@ -0,0 +1,7 @@
abstract Strings = Letters ** {
cat S ;
fun
E : S ;
C : L -> S -> S ;
}

View File

@@ -0,0 +1,5 @@
concrete StringsBW of Strings = LettersCnc ** {
lincat S = Str ;
lin E = [] ;
lin C head tail = tail ++ head ;
}

View File

@@ -0,0 +1,5 @@
concrete StringsFW of Strings = LettersCnc ** {
lincat S = Str ;
lin E = [] ;
lin C head tail = head ++ tail ;
}

View File

@@ -0,0 +1,10 @@
abstract Ticket = {
flags startcat = Request ;
cat
Request ; Station ;
fun
Ticket : Station -> Station -> Request ;
Hamburg, Paris : Station ;
}

View File

@@ -0,0 +1,19 @@
concrete TicketEng of Ticket = {
lincat
Request, Station = Str ;
lin
Ticket X Y =
((("I" ++ ("would like" | "want") ++ "to get" |
("may" | "can") ++ "I get" |
"can you give me" |
[]) ++
"a ticket") |
[]) ++
"from" ++ X ++ "to" ++ Y ++
("please" | []) ;
Hamburg = "Hamburg" ;
Paris = "Paris" ;
}