1:-include(library('ec_planner/ec_test_incl')). 2:-expects_dialect(pfc). 3 % loading(always,'examples/Mueller2006/Chapter12/BrokenDevice.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
37==> t(device,device1).
38
39% predicate Ab1(device,time)
40 % predicate(ab1(device,time)).
41==> mpred_prop(ab1(device,time),predicate).
42==> meta_argtypes(ab1(device,time)).
43
44% fluent On(device)
45 % fluent(on(device)).
46==> mpred_prop(on(device),fluent).
47==> meta_argtypes(on(device)).
48
49% fluent PluggedIn(device)
50 % fluent(pluggedIn(device)).
51==> mpred_prop(pluggedIn(device),fluent).
52==> meta_argtypes(pluggedIn(device)).
53
54% fluent BrokenSwitch(device)
55 % fluent(brokenSwitch(device)).
56==> mpred_prop(brokenSwitch(device),fluent).
57==> meta_argtypes(brokenSwitch(device)).
58
59% event TurnOn(agent,device)
60 % event(turnOn(agent,device)).
61==> mpred_prop(turnOn(agent,device),event).
62==> meta_argtypes(turnOn(agent,device)).
63
64
72axiom(initiates(turnOn(Agent, Device), on(Device), Time),
73 [not(ab1(Device, Time))]).
74
75
78
79
82axiom(happens(turnOn(nathan, device1), t),
83 [is_time(0)]).
84
85
88
91next_axiom_uses(theta).
92
93
94
97 98axiom(ab1(Device, Time),
99 [holds_at(brokenSwitch(Device), Time)]).
100
103next_axiom_uses(theta).
104
105
106
109 110axiom(ab1(Device, Time),
111 [not(holds_at(pluggedIn(Device), Time))]).
112
113
116
117
120 121axiom(not(initially(on(device1))),
122 []).
123
124
127axiom(initially(brokenSwitch(device1)),
128 []).
129
130
133
134
137axiom(initially(pluggedIn(device1)),
138 []).
139
140
141% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/BrokenDevice.e:59
142%; entailed:
143%; !HoldsAt(On(Device1),1).
144
145% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/BrokenDevice.e:62
146% completion Theta Ab1
147% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/BrokenDevice.e:63
148==> completion(theta).
149==> completion(ab1).
150
151% completion Happens
152% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/BrokenDevice.e:64
153==> completion(happens).
154
155% range time 0 1
156% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/BrokenDevice.e:66
157==> range(time,0,1).
158
159% range offset 1 1
160% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter12/BrokenDevice.e:67
161==> range(offset,1,1).