summaryrefslogtreecommitdiff
path: root/old-examples/regulus/toy0/no-resource
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-06-25 16:54:35 +0000
committeraarne <aarne@cs.chalmers.se>2008-06-25 16:54:35 +0000
commite9e80fc389365e24d4300d7d5390c7d833a96c50 (patch)
treef0b58473adaa670bd8fc52ada419d8cad470ee03 /old-examples/regulus/toy0/no-resource
parentb96b36f43de3e2f8b58d5f539daa6f6d47f25870 (diff)
changed names of resource-1.3; added a note on homepage on release
Diffstat (limited to 'old-examples/regulus/toy0/no-resource')
-rw-r--r--old-examples/regulus/toy0/no-resource/Toy0.gf15
-rw-r--r--old-examples/regulus/toy0/no-resource/Toy0Eng.gf27
-rw-r--r--old-examples/regulus/toy0/no-resource/Toy0Fre.gf29
-rw-r--r--old-examples/regulus/toy0/no-resource/Toy0Ger.gf29
-rw-r--r--old-examples/regulus/toy0/no-resource/Toy0_eng.gf39
5 files changed, 139 insertions, 0 deletions
diff --git a/old-examples/regulus/toy0/no-resource/Toy0.gf b/old-examples/regulus/toy0/no-resource/Toy0.gf
new file mode 100644
index 000000000..b1e2d6a40
--- /dev/null
+++ b/old-examples/regulus/toy0/no-resource/Toy0.gf
@@ -0,0 +1,15 @@
+-- toy0 grammar from Chapter 2 of the Regulus book
+abstract Toy0 = {
+
+ flags startcat=NP ;
+
+ cat
+ NP ;
+ Noun ;
+ Spec ;
+
+ fun
+ SpecNoun : Spec -> Noun -> NP ;
+ One, Two : Spec ;
+ Felis, Canis : Noun ;
+}
diff --git a/old-examples/regulus/toy0/no-resource/Toy0Eng.gf b/old-examples/regulus/toy0/no-resource/Toy0Eng.gf
new file mode 100644
index 000000000..977fb09c5
--- /dev/null
+++ b/old-examples/regulus/toy0/no-resource/Toy0Eng.gf
@@ -0,0 +1,27 @@
+concrete Toy0Eng of Toy0 = {
+
+param
+ Number = Sg | Pl ;
+
+lincat
+ Spec = {s : Str ; n : Number} ;
+ Noun = {s : Number => Str} ;
+ NP = {s : Str} ;
+
+lin
+ SpecNoun spec noun = {s = spec.s ++ noun.s ! spec.n} ;
+
+ One = {s = "one" ; n = Sg} ;
+ Two = {s = "two" ; n = Pl} ;
+
+ Felis = regNoun "cat" ;
+ Canis = regNoun "dog" ;
+
+oper
+ regNoun : Str -> {s : Number => Str} = \s -> {
+ s = table {
+ Sg => s ;
+ Pl => s + "s"
+ }
+ } ;
+}
diff --git a/old-examples/regulus/toy0/no-resource/Toy0Fre.gf b/old-examples/regulus/toy0/no-resource/Toy0Fre.gf
new file mode 100644
index 000000000..c5267ae18
--- /dev/null
+++ b/old-examples/regulus/toy0/no-resource/Toy0Fre.gf
@@ -0,0 +1,29 @@
+concrete Toy0Fre of Toy0 = {
+
+param
+ Number = Sg | Pl ;
+ Gender = Masc | Fem ;
+
+lincat
+ Spec = {s : Gender => Str ; n : Number} ;
+ Noun = {s : Number => Str ; g : Gender} ;
+ NP = {s : Str} ;
+
+lin
+ SpecNoun spec noun = {s = spec.s ! noun.g ++ noun.s ! spec.n} ;
+
+ One = {s = table {Fem => "une" ; _ => "un"} ; n = Sg} ;
+ Two = {s = \\_ => "deux" ; n = Pl} ;
+
+ Felis = mkNoun "chat" Masc ;
+ Canis = mkNoun "chien" Masc ;
+
+oper
+ mkNoun : Str -> Gender -> {s : Number => Str ; g : Gender} = \s,g -> {
+ s = table {
+ Sg => s ;
+ Pl => s + "s"
+ } ;
+ g = g
+ } ;
+}
diff --git a/old-examples/regulus/toy0/no-resource/Toy0Ger.gf b/old-examples/regulus/toy0/no-resource/Toy0Ger.gf
new file mode 100644
index 000000000..091790f94
--- /dev/null
+++ b/old-examples/regulus/toy0/no-resource/Toy0Ger.gf
@@ -0,0 +1,29 @@
+concrete Toy0Ger of Toy0 = {
+
+param
+ Number = Sg | Pl ;
+ Gender = Masc | Fem | Neutr ;
+
+lincat
+ Spec = {s : Gender => Str ; n : Number} ;
+ Noun = {s : Number => Str ; g : Gender} ;
+ NP = {s : Str} ;
+
+lin
+ SpecNoun spec noun = {s = spec.s ! noun.g ++ noun.s ! spec.n} ;
+
+ One = {s = table {Fem => "eine" ; _ => "ein"} ; n = Sg} ;
+ Two = {s = \\_ => "zwei" ; n = Pl} ;
+
+ Felis = mkNoun "Katze" "Katzen" Fem ;
+ Canis = mkNoun "Hund" "Hünde" Masc ;
+
+oper
+ mkNoun : Str -> Str -> Gender -> {s : Number => Str ; g : Gender} = \s,p,g -> {
+ s = table {
+ Sg => s ;
+ Pl => p
+ } ;
+ g = g
+ } ;
+}
diff --git a/old-examples/regulus/toy0/no-resource/Toy0_eng.gf b/old-examples/regulus/toy0/no-resource/Toy0_eng.gf
new file mode 100644
index 000000000..ed8fe8063
--- /dev/null
+++ b/old-examples/regulus/toy0/no-resource/Toy0_eng.gf
@@ -0,0 +1,39 @@
+-- grammar from Chapter 2 of the Regulus book
+
+flags startcat=MAIN ;
+
+cat
+ MAIN ; NP ; Noun ; Spec ;
+
+fun
+ Main : NP -> MAIN ;
+ SpecNoun : Spec -> Noun -> NP ;
+
+ One, Two : Spec ;
+ Felis, Canis : Noun ;
+
+param
+ Number = Sg | Pl ;
+
+lincat
+ Spec = {s : Str ; n : Number} ;
+ Noun = {s : Number => Str} ;
+ MAIN,NP = {s : Str} ;
+
+lin
+ Main np = np ;
+ SpecNoun spec noun = {s = spec.s ++ noun.s ! spec.n} ;
+
+ One = {s = "one" ; n = Sg} ;
+ Two = {s = "two" ; n = Pl} ;
+
+ Felis = regNoun "cat" ;
+ Canis = regNoun "dog" ;
+
+oper
+ regNoun : Str -> {s : Number => Str} = \s -> {
+ s = table {
+ Sg => s ;
+ Pl => s + "s"
+ }
+ } ;