1:-include(library('ec_planner/ec_test_incl')). 2:-expects_dialect(pfc). 3 % loading(always,'examples/Mueller2006/Chapter12/Device.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 device
31==> sort(device).
32
33% agent Nathan
34==> t(agent,nathan).
35
36% device Device1, AntiqueDevice1
37==> t(device,device1).
38==> t(device,antiqueDevice1).
39
40% predicate Ab1(device,time)
41 % predicate(ab1(device,time)).
42==> mpred_prop(ab1(device,time),predicate).
43==> meta_argtypes(ab1(device,time)).
44
45% fluent On(device)
46 % fluent(on(device)).
47==> mpred_prop(on(device),fluent).
48==> meta_argtypes(on(device)).
49
50% fluent PluggedIn(device)
51 % fluent(pluggedIn(device)).
52==> mpred_prop(pluggedIn(device),fluent).
53==> meta_argtypes(pluggedIn(device)).
54
55% fluent BrokenSwitch(device)
56 % fluent(brokenSwitch(device)).
57==> mpred_prop(brokenSwitch(device),fluent).
58==> meta_argtypes(brokenSwitch(device)).
59
60% event TurnOn(agent,device)
61 % event(turnOn(agent,device)).
62==> mpred_prop(turnOn(agent,device),event).
63==> meta_argtypes(turnOn(agent,device)).
64
65
73axiom(initiates(turnOn(Agent, Device), on(Device), Time),
74 [not(ab1(Device, Time))]).
75
76
79
80
83axiom(happens(turnOn(nathan, device1), t),
84 [is_time(0)]).
85
86
89
92next_axiom_uses(theta).
93
94
95
98 99axiom(ab1(Device, Time),
100 [holds_at(brokenSwitch(Device), Time)]).
101
104next_axiom_uses(theta).
105
106
107
110 111axiom(ab1(Device, Time),
112 [not(holds_at(pluggedIn(Device), Time))]).
113
116next_axiom_uses(theta).
117
118
119
122 123ab1(antiqueDevice1,Time).
124
125
128
129
132 133axiom(not(initially(on(device1))),
134 []).
135
136
139 140axiom(not(initially(brokenSwitch(device1))),
141 []).
142
143
146axiom(initially(pluggedIn(device1)),
147 []).
148
149
153 154 156axiom(not(holds_at(on(antiqueDevice1), Time1)),
157 []).
158
159
162 163holds_at(pluggedIn(antiqueDevice1),Time).
164
165
166% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/Device.e:62
167%; entailed:
168%; HoldsAt(On(Device1),1).
169
170% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/Device.e:65
171% completion Theta Ab1
172% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/Device.e:66
173==> completion(theta).
174==> completion(ab1).
175
176% completion Happens
177% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/Device.e:67
178==> completion(happens).
179
180% range time 0 1
181% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/Device.e:69
182==> range(time,0,1).
183
184% range offset 1 1
185% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/Device.e:70
186==> range(offset,1,1).