diff options
| author | aarne <aarne@cs.chalmers.se> | 2008-10-14 11:20:44 +0000 |
|---|---|---|
| committer | aarne <aarne@cs.chalmers.se> | 2008-10-14 11:20:44 +0000 |
| commit | a2e3b1ce73c46997ce4934ad76ed67efa93a649e (patch) | |
| tree | 2417a302d5b807be9d32627bfb95e0dc049ea17d /examples/test | |
| parent | a11f1b14370883b903da5b93de88984a3cfb9344 (diff) | |
moved paraphrases to examples/test/, meant for small grammars used for testing various aspects
Diffstat (limited to 'examples/test')
| -rw-r--r-- | examples/test/paraphrase/City.gf | 26 | ||||
| -rw-r--r-- | examples/test/paraphrase/CityEng.gf | 16 | ||||
| -rw-r--r-- | examples/test/paraphrase/Nat.gf | 29 |
3 files changed, 71 insertions, 0 deletions
diff --git a/examples/test/paraphrase/City.gf b/examples/test/paraphrase/City.gf new file mode 100644 index 000000000..2ea8a10ff --- /dev/null +++ b/examples/test/paraphrase/City.gf @@ -0,0 +1,26 @@ +abstract City = { + +cat S ; City ; Country ; Adj ; + +data + PredIn : City -> Country -> S ; +fun + PredAdj : City -> Adj -> S ; + Capital : Country -> City ; + CountryAdj : Adj -> Country ; +data + Stockholm, Helsinki : City ; + Sweden, Finland : Country ; + Swedish, Finnish : Adj ; + +def + PredAdj city x = PredIn city (CountryAdj x) ; + + Capital Finland = Helsinki ; + Capital Sweden = Stockholm ; + + CountryAdj Finnish = Finland ; + CountryAdj Swedish = Sweden ; + + +} diff --git a/examples/test/paraphrase/CityEng.gf b/examples/test/paraphrase/CityEng.gf new file mode 100644 index 000000000..39a0974c8 --- /dev/null +++ b/examples/test/paraphrase/CityEng.gf @@ -0,0 +1,16 @@ +concrete CityEng of City = { + +lincat S, City, Country, Adj = Str ; + +lin + PredIn ci co = ci ++ "is in" ++ co ; + PredAdj ci ad = ci ++ "is" ++ ad ; + Capital co = "the capital of" ++ co ; + CountryAdj ad = "the" ++ ad ++ "country" ; + Stockholm = "Stockholm" ; + Helsinki = "Helsinki" ; + Sweden = "Sweden" ; + Finland = "Finland" ; + Swedish = "Swedish" ; + Finnish = "Finnish" ; +} diff --git a/examples/test/paraphrase/Nat.gf b/examples/test/paraphrase/Nat.gf new file mode 100644 index 000000000..7caa0fc93 --- /dev/null +++ b/examples/test/paraphrase/Nat.gf @@ -0,0 +1,29 @@ +abstract Nat = { + +cat Nat ; + +data + Zero : Nat ; + Succ : Nat -> Nat ; + +fun one : Nat ; +def one = Succ Zero ; + +fun plus : Nat -> Nat -> Nat ; +def plus x Zero = x ; +def plus x (Succ y) = Succ (plus x y) ; + +fun twice : Nat -> Nat ; +def twice x = plus x x ; + +fun times : Nat -> Nat -> Nat ; +def times x Zero = Zero ; +def times x (Succ y) = plus (times x y) x ; + +fun four : Nat ; +def four = twice (twice one) ; + +fun exp : Nat -> Nat ; +def exp Zero = one ; +def exp (Succ x) = twice (exp x) ; +} |
