1:-include(library('ec_planner/ec_test_incl')). 2:-expects_dialect(pfc). 3 % loading(always,'ecnet/GSpace.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%; GSpace: grid space
15%;
16%; @book{Mueller:1998,
17%; author = "Erik T. Mueller",
18%; year = "1998",
19%; title = "Natural Language Processing with \uppercase{T}hought\uppercase{T}reasure",
20%; address = "New York",
21%; publisher = "Signiform",
22%; }
23%;
24
25% sort coord: integer
26==> subsort(coord,integer).
27
28% sort grid
29==> sort(grid).
30%; object is at (coord1, coord2) in grid.
31
32% fluent GridAt(grid,object,coord,coord)
33 % fluent(gridAt(grid,object,coord,coord)).
34==> mpred_prop(gridAt(grid,object,coord,coord),fluent).
35==> meta_argtypes(gridAt(grid,object,coord,coord)).
36
37
38% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/GSpace.e:27
39%; agent walks from (coord1, coord2)
40%; to (coord3, coord4) in grid.
41
42% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/GSpace.e:29
43% event GridWalk(grid,agent,coord,coord,coord,coord)
44 % event(gridWalk(grid,agent,coord,coord,coord,coord)).
45% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/GSpace.e:30
46==> mpred_prop(gridWalk(grid,agent,coord,coord,coord,coord),event).
47==> meta_argtypes(gridWalk(grid,agent,coord,coord,coord,coord)).
48
49
58
59 62
63 74axiom(not(holds_at(gridAt(GridAt_Param, A, Equals_Param, Equals_Param10), Time7)),
75
76 [ not(equals(Equals_Param, Equals_Ret)),
77 holds_at(gridAt(GridAt_Param,
78 A,
79 Equals_Ret,
80 GridAt_Ret),
81 Time7)
82 ]).
83axiom(not(holds_at(gridAt(GridAt_Param, A, Equals_Param, Equals_Param10), Time7)),
84
85 [ not(equals(Equals_Param10, GridAt_Ret)),
86 holds_at(gridAt(GridAt_Param,
87 A,
88 Equals_Ret,
89 GridAt_Ret),
90 Time7)
91 ]).
92
93 103axiom(not(holds_at(gridAt(GridAt_Param14, A, Equals_Ret18, GridAt_Ret17), Time13)),
104
105 [ not(equals(Equals_Param15, Equals_Ret18)),
106 holds_at(gridAt(GridAt_Param14,
107 A,
108 Equals_Param15,
109 Equals_Param16),
110 Time13)
111 ]).
112axiom(not(holds_at(gridAt(GridAt_Param14, A, Equals_Ret18, GridAt_Ret17), Time13)),
113
114 [ not(equals(Equals_Param16, GridAt_Ret17)),
115 holds_at(gridAt(GridAt_Param14,
116 A,
117 Equals_Param15,
118 Equals_Param16),
119 Time13)
120 ]).
121
122 134axiom(equals(Equals_Param20, Equals_Ret22),
135
136 [ holds_at(gridAt(GridAt_Param21,
137 A,
138 Equals_Param20,
139 GridAt_Ret23),
140 Time19),
141 holds_at(gridAt(GridAt_Param21,
142 A,
143 Equals_Ret22,
144 GridAt_Ret24),
145 Time19)
146 ]).
147
148 154axiom(equals(Equals_Param26, Equals_Ret28),
155
156 [ holds_at(gridAt(GridAt_Param27,
157 A,
158 _,
159 Equals_Param26),
160 Time25),
161 holds_at(gridAt(GridAt_Param27, A, _, Equals_Ret28),
162 Time25)
163 ]).
164
165
176axiom(initiates(gridWalk(Grid, Agent, Coord1, Coord2, Coord3, Coord4), gridAt(Grid, Agent, Coord3, Coord4), Time),
177 []).
178
179
190axiom(terminates(gridWalk(Grid, Agent, Coord1, Coord2, Coord3, Coord4), gridAt(Grid, Agent, Coord1, Coord2), Time),
191 []).
192
193
212axiom(requires(gridWalk(Grid, Agent, Coord1, Coord2, Coord3, Coord4), Time),
213
214 [ equals(Coord2, Coord4),
215 equals(Coord1, Coord3),
216 holds_at(gridAt(Grid, Agent, Coord1, Coord2),
217 Time),
218 not(holds_at(gridAt(Grid, Object, Coord3, Coord4),
219 Time))
220 ]).
221axiom(requires(gridWalk(Grid, Agent, Coord1, Coord2, Coord3, Coord4), Time),
222
223 [ equals(Coord2, Coord4+1),
224 equals(Coord1, Coord3),
225 holds_at(gridAt(Grid, Agent, Coord1, Coord2),
226 Time),
227 not(holds_at(gridAt(Grid, Object, Coord3, Coord4),
228 Time))
229 ]).
230axiom(requires(gridWalk(Grid, Agent, Coord1, Coord2, Coord3, Coord4), Time),
231
232 [ equals(Coord2, Coord4-1),
233 equals(Coord1, Coord3),
234 holds_at(gridAt(Grid, Agent, Coord1, Coord2),
235 Time),
236 not(holds_at(gridAt(Grid, Object, Coord3, Coord4),
237 Time))
238 ]).
239axiom(requires(gridWalk(Grid, Agent, Coord1, Coord2, Coord3, Coord4), Time),
240
241 [ equals(Coord2, Coord4),
242 equals(Coord1, Coord3+1),
243 holds_at(gridAt(Grid, Agent, Coord1, Coord2),
244 Time),
245 not(holds_at(gridAt(Grid, Object, Coord3, Coord4),
246 Time))
247 ]).
248axiom(requires(gridWalk(Grid, Agent, Coord1, Coord2, Coord3, Coord4), Time),
249
250 [ equals(Coord2, Coord4+1),
251 equals(Coord1, Coord3+1),
252 holds_at(gridAt(Grid, Agent, Coord1, Coord2),
253 Time),
254 not(holds_at(gridAt(Grid, Object, Coord3, Coord4),
255 Time))
256 ]).
257axiom(requires(gridWalk(Grid, Agent, Coord1, Coord2, Coord3, Coord4), Time),
258
259 [ equals(Coord2, Coord4-1),
260 equals(Coord1, Coord3+1),
261 holds_at(gridAt(Grid, Agent, Coord1, Coord2),
262 Time),
263 not(holds_at(gridAt(Grid, Object, Coord3, Coord4),
264 Time))
265 ]).
266axiom(requires(gridWalk(Grid, Agent, Coord1, Coord2, Coord3, Coord4), Time),
267
268 [ equals(Coord2, Coord4),
269 equals(Coord1, Coord3-1),
270 holds_at(gridAt(Grid, Agent, Coord1, Coord2),
271 Time),
272 not(holds_at(gridAt(Grid, Object, Coord3, Coord4),
273 Time))
274 ]).
275axiom(requires(gridWalk(Grid, Agent, Coord1, Coord2, Coord3, Coord4), Time),
276
277 [ equals(Coord2, Coord4+1),
278 equals(Coord1, Coord3-1),
279 holds_at(gridAt(Grid, Agent, Coord1, Coord2),
280 Time),
281 not(holds_at(gridAt(Grid, Object, Coord3, Coord4),
282 Time))
283 ]).
284axiom(requires(gridWalk(Grid, Agent, Coord1, Coord2, Coord3, Coord4), Time),
285
286 [ equals(Coord2, Coord4-1),
287 equals(Coord1, Coord3-1),
288 holds_at(gridAt(Grid, Agent, Coord1, Coord2),
289 Time),
290 not(holds_at(gridAt(Grid, Object, Coord3, Coord4),
291 Time))
292 ]).
293
294