1:-include(library('ec_planner/ec_test_incl')). 2:-expects_dialect(pfc). 3 % loading(always,'examples/Shanahan1997/Supermarket.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%; \fullciteA[pp. 302--304]{Shanahan:1997}
15%;
16%; @book{Shanahan:1997,
17%; author = "Murray Shanahan",
18%; year = "1997",
19%; title = "Solving the Frame Problem",
20%; address = "Cambridge, MA",
21%; publisher = "MIT Press",
22%; }
23%;
24%; deduction
25%;
26%; modifications from Shanahan's formulation:
27%; reformulated using the method of \fullciteA[pp. 460--461]{MillerShanahan:2002}
28%;
29%; @incollection{MillerShanahan:2002,
30%; author = "Rob Miller and Murray Shanahan",
31%; year = "2002",
32%; title = "Some alternative formulations of the event calculus",
33%; editor = "Antonis C. Kakas and Fariba Sadri",
34%; booktitle = "Computational Logic: Logic Programming and Beyond: Essays in Honour of \uppercase{R}obert \uppercase{A}. \uppercase{K}owalski, Part \uppercase{II}",
35%; series = "Lecture Notes in Computer Science",
36%; volume = "2408",
37%; pages = "452--490",
38%; address = "Berlin",
39%; publisher = "Springer",
40%; }
41%;
42%; added:
43%; !HoldsAt(Forwards(), 0).
44%; !HoldsAt(Backwards(), 0).
45%; !HoldsAt(Spinning(), 0).
46%;
47
48% load foundations/Root.e
49
50% load foundations/EC.e
51
52% event Push()
53 % event(push()).
54==> mpred_prop(push(),event).
55==> meta_argtypes(push()).
56
57% event Pull()
58 % event(pull()).
59==> mpred_prop(pull(),event).
60==> meta_argtypes(pull()).
61
62% fluent Forwards()
63 % fluent(forwards()).
64==> mpred_prop(forwards(),fluent).
65==> meta_argtypes(forwards()).
66
67% fluent Backwards()
68 % fluent(backwards()).
69==> mpred_prop(backwards(),fluent).
70==> meta_argtypes(backwards()).
71
72% fluent Spinning()
73 % fluent(spinning()).
74==> mpred_prop(spinning(),fluent).
75==> meta_argtypes(spinning()).
76
77
83axiom(initiates(push(), forwards(), Time),
84 [not(happens(pull(), Time))]).
85
86
92axiom(terminates(push(), backwards(), Time),
93 [not(happens(pull(), Time))]).
94
95
101axiom(initiates(pull(), backwards(), Time),
102 [not(happens(push(), Time))]).
103
104
110axiom(terminates(pull(), forwards(), Time),
111 [not(happens(push(), Time))]).
112
113
119axiom(requires(push(), Time),
120 [initiates(pull(), spinning(), Time)]).
121
122
128axiom(requires(push(), Time),
129 [terminates(pull(), forwards(), Time)]).
130
131
137axiom(requires(push(), Time),
138 [terminates(pull(), backwards(), Time)]).
139
140
146axiom(terminates(push(), spinning(), Time),
147 [not(happens(pull(), Time))]).
148
149
155axiom(terminates(pull(), spinning(), Time),
156 [not(happens(push(), Time))]).
157
158
161 162axiom(not(initially(forwards())),
163 []).
164
165
168 169axiom(not(initially(backwards())),
170 []).
171
172
175 176axiom(not(initially(spinning())),
177 []).
178
179
182axiom(happens(push(), t5),
183 [is_time(5), b(t, t5), ignore(t+5=t5)]).
184
185
188axiom(happens(pull(), t5),
189 [is_time(5), b(t, t5), ignore(t+5=t5)]).
190
191
194axiom(happens(pull(), t10),
195 [is_time(10), b(t, t10), ignore(t+10=t10)]).
196
197
200axiom(happens(push(), t10),
201 [is_time(10), b(t, t10), ignore(t+10=t10)]).
202
203% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1997/Supermarket.e:98
204% completion Happens
205% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1997/Supermarket.e:99
206==> completion(happens).
207
208% range time 0 12
209% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1997/Supermarket.e:101
210==> range(time,0,12).
211
212% range offset 1 1
213% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1997/Supermarket.e:102
214==> range(offset,1,1).