summaryrefslogtreecommitdiff
path: root/examples/godis-tram/Tram/TramSystem.gf
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2006-11-08 15:08:09 +0000
committeraarne <aarne@cs.chalmers.se>2006-11-08 15:08:09 +0000
commiteb3d750459c5ab6fd0fa2266175e1ad4a4e3d33f (patch)
tree8171f7d4ed14c9821a508a6471ee8733fdc7808f /examples/godis-tram/Tram/TramSystem.gf
parent1fd01130157b81d1b8f4e334f93efa25acf0ecc3 (diff)
godis tram grammars, augmented with Fin
Diffstat (limited to 'examples/godis-tram/Tram/TramSystem.gf')
-rw-r--r--examples/godis-tram/Tram/TramSystem.gf64
1 files changed, 64 insertions, 0 deletions
diff --git a/examples/godis-tram/Tram/TramSystem.gf b/examples/godis-tram/Tram/TramSystem.gf
new file mode 100644
index 000000000..a304e1203
--- /dev/null
+++ b/examples/godis-tram/Tram/TramSystem.gf
@@ -0,0 +1,64 @@
+--# -path=.:../Common:prelude
+
+abstract TramSystem = GodisSystem, Stops, Lines ** {
+
+cat
+Route; -- route descripiption.
+Leg;
+[Leg]{2}; -- route segments on a line
+-- the following are derived from declaring [Leg]{2}:
+-- BaseLeg : Leg -> Leg -> [Leg];
+-- ConsLeg : Leg -> [Leg] -> [Leg];
+
+
+fun
+
+-----------------------------------------------------------------
+-- Functions for creating routes
+
+lineLeg : Line -> Stop -> Stop -> Leg;
+
+oneLeg : Leg -> Route;
+mkRoute : [Leg] -> Route;
+
+-------------------------------------------------------------------
+-- Predicates
+-- Questions and Propositions as they are intended to be used
+-- by either System or User
+
+-- U: what is the shortest route?
+shortest_route_Q : Question;
+
+-- S: Take Tram Z from X to Y. Take...
+shortest_route_P : Route -> Proposition;
+
+-- S: Where do you want to go to?
+dest_stop_Q : Question;
+
+-- U: I want to go to Stop
+dest_stop_P : Stop -> Proposition;
+
+-- S: Where do you want to go from?
+dept_stop_Q : Question;
+
+-- U: I want to go from Stop
+dept_stop_P : Stop -> Proposition;
+
+
+-----------------------------------------------------------------
+-- Short answers
+
+-- U: "klippan"
+stop : Stop -> ShortAns;
+
+
+------------------------------------------------------------------
+-- Actions
+
+-- S: GoTGoDiS is a tram information system
+help: Action;
+
+-- S: restarting
+top: Action;
+
+}