blob: c2ea38a3fe2d4c51cdb762f17838abd0b7777252 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
--# -path=.:../Common:prelude
concrete TramUserSem of TramUser = GodisUserSem, StopsSem **
open Prolog, TramSystemSem in {
lin
-------------------------------------------------------------
-- Predicates and questions
shortest_route = pm1 (ask shortest_route_Q);
shortest_route__dept x = pm2 (ask shortest_route_Q) (answer (dept_stop_P x));
shortest_route__dest x = pm2 (ask shortest_route_Q) (answer (dest_stop_P x));
shortest_route__dept_dest x y = pm3 (ask shortest_route_Q) (answer (dept_stop_P x)) (answer (dest_stop_P y));
dest_stop x = pm1 (answer (dest_stop_P x));
dept_stop x = pm1 (answer (dept_stop_P x));
dept_dest_stop x y = pm2 (answer (dept_stop_P x)) (answer (dest_stop_P y));
--------------------------------------------------
-- Short answers
stop x = pm1 (shortAns (stop x));
stop_dest_stop x y = pm2 (shortAns(stop x)) (answer(dest_stop_P y));
stop_dept_stop x y = pm2 (shortAns(stop x)) (answer(dept_stop_P y));
------------------------------------------------------
-- Actions
top = pm1 (request top);
help = pm1 (request help);
}
|