diff options
| author | aarne <aarne@chalmers.se> | 2011-01-11 15:46:43 +0000 |
|---|---|---|
| committer | aarne <aarne@chalmers.se> | 2011-01-11 15:46:43 +0000 |
| commit | e7439d65b0e153434d3acc07df6e2a0972ee79ca (patch) | |
| tree | 36716eec18256eeb600b4a552d9cc80f8ad7f16f /gf-book/examples/chapter2 | |
| parent | 276327f7f264e770478a6d8c6e683266505b0a55 (diff) | |
gf-book web page index and toc
Diffstat (limited to 'gf-book/examples/chapter2')
| -rw-r--r-- | gf-book/examples/chapter2/Copy.gf | 7 | ||||
| -rw-r--r-- | gf-book/examples/chapter2/CopyAbs.gf | 6 | ||||
| -rw-r--r-- | gf-book/examples/chapter2/Food.gf | 13 | ||||
| -rw-r--r-- | gf-book/examples/chapter2/Food.probs | 4 | ||||
| -rw-r--r-- | gf-book/examples/chapter2/FoodEng.gf | 19 | ||||
| -rw-r--r-- | gf-book/examples/chapter2/FoodHin.gf | 24 | ||||
| -rw-r--r-- | gf-book/examples/chapter2/FoodIta.gf | 19 | ||||
| -rw-r--r-- | gf-book/examples/chapter2/Letters.gf | 8 | ||||
| -rw-r--r-- | gf-book/examples/chapter2/LettersCnc.gf | 31 | ||||
| -rw-r--r-- | gf-book/examples/chapter2/Strings.gf | 7 | ||||
| -rw-r--r-- | gf-book/examples/chapter2/StringsBW.gf | 5 | ||||
| -rw-r--r-- | gf-book/examples/chapter2/StringsFW.gf | 5 | ||||
| -rw-r--r-- | gf-book/examples/chapter2/Ticket.gf | 10 | ||||
| -rw-r--r-- | gf-book/examples/chapter2/TicketEng.gf | 19 | ||||
| -rw-r--r-- | gf-book/examples/chapter2/foodEng.cf | 14 | ||||
| -rw-r--r-- | gf-book/examples/chapter2/foodIta.cf | 14 |
16 files changed, 205 insertions, 0 deletions
diff --git a/gf-book/examples/chapter2/Copy.gf b/gf-book/examples/chapter2/Copy.gf new file mode 100644 index 000000000..58d74861c --- /dev/null +++ b/gf-book/examples/chapter2/Copy.gf @@ -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 ; +} diff --git a/gf-book/examples/chapter2/CopyAbs.gf b/gf-book/examples/chapter2/CopyAbs.gf new file mode 100644 index 000000000..9a915568b --- /dev/null +++ b/gf-book/examples/chapter2/CopyAbs.gf @@ -0,0 +1,6 @@ +abstract CopyAbs = { + cat S ; AB ; + fun s : AB -> S ; + end : AB ; + a,b : AB -> AB ; +} diff --git a/gf-book/examples/chapter2/Food.gf b/gf-book/examples/chapter2/Food.gf new file mode 100644 index 000000000..7cf779b4c --- /dev/null +++ b/gf-book/examples/chapter2/Food.gf @@ -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 ; +} diff --git a/gf-book/examples/chapter2/Food.probs b/gf-book/examples/chapter2/Food.probs new file mode 100644 index 000000000..2d75774a1 --- /dev/null +++ b/gf-book/examples/chapter2/Food.probs @@ -0,0 +1,4 @@ + This 0.8 + Mod 0.2 + Wine 0.0 + Fresh 0.4 diff --git a/gf-book/examples/chapter2/FoodEng.gf b/gf-book/examples/chapter2/FoodEng.gf new file mode 100644 index 000000000..f2ed510fe --- /dev/null +++ b/gf-book/examples/chapter2/FoodEng.gf @@ -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" ; +} diff --git a/gf-book/examples/chapter2/FoodHin.gf b/gf-book/examples/chapter2/FoodHin.gf new file mode 100644 index 000000000..0f6f25c5e --- /dev/null +++ b/gf-book/examples/chapter2/FoodHin.gf @@ -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 = "अरुचिकर" ; + } + + + + diff --git a/gf-book/examples/chapter2/FoodIta.gf b/gf-book/examples/chapter2/FoodIta.gf new file mode 100644 index 000000000..466104432 --- /dev/null +++ b/gf-book/examples/chapter2/FoodIta.gf @@ -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" ; +} diff --git a/gf-book/examples/chapter2/Letters.gf b/gf-book/examples/chapter2/Letters.gf new file mode 100644 index 000000000..2b5a62d2d --- /dev/null +++ b/gf-book/examples/chapter2/Letters.gf @@ -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 ; + +} diff --git a/gf-book/examples/chapter2/LettersCnc.gf b/gf-book/examples/chapter2/LettersCnc.gf new file mode 100644 index 000000000..3301f5465 --- /dev/null +++ b/gf-book/examples/chapter2/LettersCnc.gf @@ -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" ; +} diff --git a/gf-book/examples/chapter2/Strings.gf b/gf-book/examples/chapter2/Strings.gf new file mode 100644 index 000000000..411ceed53 --- /dev/null +++ b/gf-book/examples/chapter2/Strings.gf @@ -0,0 +1,7 @@ +abstract Strings = Letters ** { + +cat S ; +fun + E : S ; + C : L -> S -> S ; +} diff --git a/gf-book/examples/chapter2/StringsBW.gf b/gf-book/examples/chapter2/StringsBW.gf new file mode 100644 index 000000000..8e558d953 --- /dev/null +++ b/gf-book/examples/chapter2/StringsBW.gf @@ -0,0 +1,5 @@ +concrete StringsBW of Strings = LettersCnc ** { + lincat S = Str ; + lin E = [] ; + lin C head tail = tail ++ head ; +} diff --git a/gf-book/examples/chapter2/StringsFW.gf b/gf-book/examples/chapter2/StringsFW.gf new file mode 100644 index 000000000..c0f80c313 --- /dev/null +++ b/gf-book/examples/chapter2/StringsFW.gf @@ -0,0 +1,5 @@ +concrete StringsFW of Strings = LettersCnc ** { + lincat S = Str ; + lin E = [] ; + lin C head tail = head ++ tail ; +} diff --git a/gf-book/examples/chapter2/Ticket.gf b/gf-book/examples/chapter2/Ticket.gf new file mode 100644 index 000000000..f3f2dd851 --- /dev/null +++ b/gf-book/examples/chapter2/Ticket.gf @@ -0,0 +1,10 @@ +abstract Ticket = { + +flags startcat = Request ; +cat + Request ; Station ; +fun + Ticket : Station -> Station -> Request ; + Hamburg, Paris : Station ; + +} diff --git a/gf-book/examples/chapter2/TicketEng.gf b/gf-book/examples/chapter2/TicketEng.gf new file mode 100644 index 000000000..54e44741d --- /dev/null +++ b/gf-book/examples/chapter2/TicketEng.gf @@ -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" ; + +} diff --git a/gf-book/examples/chapter2/foodEng.cf b/gf-book/examples/chapter2/foodEng.cf new file mode 100644 index 000000000..3216f2e30 --- /dev/null +++ b/gf-book/examples/chapter2/foodEng.cf @@ -0,0 +1,14 @@ +Pred. Comment ::= Item "is" Quality +This. Item ::= "this" Kind +That. Item ::= "that" Kind +Mod. Kind ::= Quality Kind +Wine. Kind ::= "wine" +Cheese. Kind ::= "cheese" +Fish. Kind ::= "fish" +Very. Quality ::= "very" Quality +Fresh. Quality ::= "fresh" +Warm. Quality ::= "warm" +Italian. Quality ::= "Italian" +Expensive. Quality ::= "expensive" +Delicious. Quality ::= "delicious" +Boring. Quality ::= "boring" diff --git a/gf-book/examples/chapter2/foodIta.cf b/gf-book/examples/chapter2/foodIta.cf new file mode 100644 index 000000000..02b825ed0 --- /dev/null +++ b/gf-book/examples/chapter2/foodIta.cf @@ -0,0 +1,14 @@ +Pred. Comment ::= Item "è" Quality +This. Item ::= "questo" Kind +That. Item ::= "quel" Kind +Mod. Kind ::= Kind Quality +Wine. Kind ::= "vino" +Cheese. Kind ::= "formaggio" +Fish. Kind ::= "pesce" +Very. Quality ::= "molto" Quality +Fresh. Quality ::= "fresco" +Warm. Quality ::= "caldo" +Italian. Quality ::= "italiano" +Expensive. Quality ::= "caro" +Delicious. Quality ::= "delizioso" +Boring. Quality ::= "noioso" |
