1:-include(library('ec_planner/ec_test_incl')). 2:-expects_dialect(pfc). 3 % loading(always,'examples/Shanahan1999/ThielscherCircuit.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%; @article{Thielscher:1997,
15%; author = "Michael Thielscher",
16%; year = "1997",
17%; title = "Ramification and causality",
18%; journal = "Artificial Intelligence",
19%; volume = "89",
20%; pages = "317--364",
21%; }
22%;
23%; @incollection{Shanahan:1999,
24%; author = "Shanahan, Murray",
25%; year = "1999",
26%; title = "The Event Calculus explained",
27%; editor = "Michael J. Wooldridge and Manuela M. Veloso",
28%; booktitle = "Artificial Intelligence Today: Recent Trends and Developments",
29%; series = "Lecture Notes in Computer Science",
30%; volume = "1600",
31%; pages = "409--430",
32%; address = "Berlin",
33%; publisher = "Springer",
34%; }
35%;
36%; deduction
37%;
38%; modifications from Shanahan's formulation:
39%; timestamps
40%;
41
42% load foundations/Root.e
43
44% load foundations/EC.e
45
46% load foundations/ECCausal.e
47
48% event LightOn()
49 % event(lightOn()).
50==> mpred_prop(lightOn(),event).
51==> meta_argtypes(lightOn()).
52
53% event Close1()
54 % event(close1()).
55==> mpred_prop(close1(),event).
56==> meta_argtypes(close1()).
57
58% event Open2()
59 % event(open2()).
60==> mpred_prop(open2(),event).
61==> meta_argtypes(open2()).
62
63% event CloseRelay()
64 % event(closeRelay()).
65==> mpred_prop(closeRelay(),event).
66==> meta_argtypes(closeRelay()).
67
68% fluent Light()
69 % fluent(light()).
70==> mpred_prop(light(),fluent).
71==> meta_argtypes(light()).
72
73% fluent Switch1()
74 % fluent(switch1()).
75==> mpred_prop(switch1(),fluent).
76==> meta_argtypes(switch1()).
77
78% fluent Switch2()
79 % fluent(switch2()).
80==> mpred_prop(switch2(),fluent).
81==> meta_argtypes(switch2()).
82
83% fluent Switch3()
84 % fluent(switch3()).
85==> mpred_prop(switch3(),fluent).
86==> meta_argtypes(switch3()).
87
88% fluent Relay()
89 % fluent(relay()).
90==> mpred_prop(relay(),fluent).
91==> meta_argtypes(relay()).
92
93
101axiom(happens(lightOn(), Time),
102
103 [ stopped(light(), Time),
104 initiated(switch1(), Time),
105 initiated(switch2(), Time)
106 ]).
107
108
115axiom(happens(open2(), Time),
116 [started(switch2(), Time), initiated(relay(), Time)]).
117
118
126axiom(happens(closeRelay(), Time),
127
128 [ stopped(relay(), Time),
129 initiated(switch1(), Time),
130 initiated(switch3(), Time)
131 ]).
132
133
136 137axiom(initiates(lightOn(), light(), Time),
138 []).
139
140
143 144axiom(terminates(open2(), switch2(), Time),
145 []).
146
147
150 151axiom(initiates(closeRelay(), relay(), Time),
152 []).
153
154
157 158axiom(initiates(close1(), switch1(), Time),
159 []).
160
161
164 165axiom(not(initially(switch1())),
166 []).
167
168
171axiom(initially(switch2()),
172 []).
173
174
177axiom(initially(switch3()),
178 []).
179
180
183 184axiom(not(initially(relay())),
185 []).
186
187
190 191axiom(not(initially(light())),
192 []).
193
194
197axiom(happens(close1(), t),
198 [is_time(0)]).
199
200% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ThielscherCircuit.e:86
201% completion Happens
202% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ThielscherCircuit.e:87
203==> completion(happens).
204
205% range time 0 1
206% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ThielscherCircuit.e:89
207==> range(time,0,1).
208
209% range offset 1 1
210% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/ThielscherCircuit.e:90
211==> range(offset,1,1).