1:-include(library('ec_planner/ec_test_incl')). 2:-expects_dialect(pfc). 3 % loading(always,'examples/Shanahan1999/ChessBoard.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%; due to Raymond Reiter
15%;
16%; @inproceedings{KarthaLifschitz:1994,
17%; author = "G. Neelakantan Kartha and Vladimir Lifschitz",
18%; year = "1994",
19%; title = "Actions with indirect effects (preliminary report)",
20%; editor = "Jon Doyle and Erik Sandewall and Pietro Torasso",
21%; booktitle = "\uppercase{P}roceedings of the \uppercase{F}ourth \uppercase{I}nternational \uppercase{C}onference on \uppercase{P}rinciples of \uppercase{K}nowledge \uppercase{R}epresentation and \uppercase{R}easoning",
22%; pages = "341--350",
23%; address = "San Francisco",
24%; publisher = "Morgan Kaufmann",
25%; }
26%;
27%; @incollection{Shanahan:1999,
28%; author = "Shanahan, Murray",
29%; year = "1999",
30%; title = "The Event Calculus explained",
31%; editor = "Michael J. Wooldridge and Manuela M. Veloso",
32%; booktitle = "Artificial Intelligence Today: Recent Trends and Developments",
33%; series = "Lecture Notes in Computer Science",
34%; volume = "1600",
35%; pages = "409--430",
36%; address = "Berlin",
37%; publisher = "Springer",
38%; }
39%;
40%; model finding
41%;
42%; modifications from Shanahan's formulation:
43%; InitiallyN -> !HoldsAt
44%; pruning of models irrelevant to example
45%; timestamps
46%;
47
48% load foundations/Root.e
49
50% load foundations/EC.e
51
52% event Throw()
53 % event(throw()).
54==> mpred_prop(throw(),event).
55==> meta_argtypes(throw()).
56
57% fluent ItsBlack()
58 % fluent(itsBlack()).
59==> mpred_prop(itsBlack(),fluent).
60==> meta_argtypes(itsBlack()).
61
62% fluent ItsWhite()
63 % fluent(itsWhite()).
64==> mpred_prop(itsWhite(),fluent).
65==> meta_argtypes(itsWhite()).
66
67% fluent OnBlack()
68 % fluent(onBlack()).
69==> mpred_prop(onBlack(),fluent).
70==> meta_argtypes(onBlack()).
71
72% fluent OnWhite()
73 % fluent(onWhite()).
74==> mpred_prop(onWhite(),fluent).
75==> meta_argtypes(onWhite()).
76
77% noninertial ItsBlack, ItsWhite
78==> noninertial(itsBlack).
79==> noninertial(itsWhite).
80
81
87axiom(initiates(throw(), onWhite(), Time),
88 [holds_at(itsWhite(), Time)]).
89
90
96axiom(initiates(throw(), onBlack(), Time),
97 [holds_at(itsBlack(), Time)]).
98
99
102 103
104 108
109 112axiom(holds_at(itsWhite(), Time1),
113 [not(holds_at(itsBlack(), Time1))]).
114
115 118axiom(holds_at(itsBlack(), Time2),
119 [not(holds_at(itsWhite(), Time2))]).
120
121
124 125axiom(not(initially(onWhite())),
126 []).
127
128
131 132axiom(not(initially(onBlack())),
133 []).
134
135
138axiom(happens(throw(), start),
139 [is_time(1), b(t, start), ignore(t+1=start)]).
140
141
144
145
148axiom(initially(itsWhite()),
149 []).
150
151
154axiom(initially(itsBlack()),
155 []).
156
157
160holds_at(itsWhite(),2).
161
162
165holds_at(itsBlack(),2).
166
167% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ChessBoard.e:74
168% completion Happens
169% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ChessBoard.e:75
170==> completion(happens).
171
172% range time 0 2
173% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ChessBoard.e:77
174==> range(time,0,2).
175
176% range offset 1 1
177% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ChessBoard.e:78
178==> range(offset,1,1).