1:-include(library('ec_planner/ec_test_incl')). 2:-expects_dialect(pfc). 3 % loading(always,'examples/Mueller2006/Chapter9/RunningAndDriving.e').
4%;
5%; Copyright (c) 2005 IBM Corporation and others.
6%; All rights reserved. This program and the accompanying materials
7%; are made available under the terms of the Common Public License v1.0
8%; which accompanies this distribution, and is available at
9%; http://www.eclipse.org/legal/cpl-v10.html
10%;
11%; Contributors:
12%; IBM - Initial implementation
13%;
14%; @book{Mueller:2006,
15%; author = "Erik T. Mueller",
16%; year = "2006",
17%; title = "Commonsense Reasoning",
18%; address = "San Francisco",
19%; publisher = "Morgan Kaufmann/Elsevier",
20%; }
21%;
22
23% load foundations/Root.e
24
25% load foundations/EC.e
26
27% sort agent
28==> sort(agent).
29
30% sort location
31==> sort(location).
32
33% agent James
34==> t(agent,james).
35
36% location Bookstore
37==> t(location,bookstore).
38
39% fluent Tired(agent)
40 % fluent(tired(agent)).
41==> mpred_prop(tired(agent),fluent).
42==> meta_argtypes(tired(agent)).
43
44% event Go(agent,location)
45 % event(go(agent,location)).
46==> mpred_prop(go(agent,location),event).
47==> meta_argtypes(go(agent,location)).
48
49% event Run(agent,location)
50 % event(run(agent,location)).
51==> mpred_prop(run(agent,location),event).
52==> meta_argtypes(run(agent,location)).
53
54% event Drive(agent,location)
55 % event(drive(agent,location)).
56==> mpred_prop(drive(agent,location),event).
57==> meta_argtypes(drive(agent,location)).
58
59
64
65 68
69 74axiom(happens(run(Run_Param, Run_Ret), Maptime),
75
76 [ not(happens(drive(Run_Param, Run_Ret), Maptime)),
77 happens(go(Run_Param, Run_Ret), Maptime)
78 ]).
79
80 84axiom(happens(drive(Drive_Param, Drive_Ret), Maptime6),
85
86 [ not(happens(run(Drive_Param, Drive_Ret), Maptime6)),
87 happens(go(Drive_Param, Drive_Ret), Maptime6)
88 ]).
89
90 94axiom(not(happens(go(Go_Param, Go_Ret), Maptime9)),
95
96 [ not(happens(run(Go_Param, Go_Ret), Maptime9)),
97 not(happens(drive(Go_Param, Go_Ret), Maptime9))
98 ]).
99
103xor([run,drive]).
104
105
108 109axiom(initiates(run(Agent, Location), tired(Agent), Time),
110 []).
111
112
115 116axiom(not(initially(tired(james))),
117 []).
118
119
122axiom(happens(go(james, bookstore), t),
123 [is_time(0)]).
124
125
128holds_at(tired(james),1).
129
130% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter9/RunningAndDriving.e:46
131% range time 0 1
132% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter9/RunningAndDriving.e:47
133==> range(time,0,1).
134
135% range offset 1 1
136% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter9/RunningAndDriving.e:48
137==> range(offset,1,1).