1:-include(library('ec_planner/ec_test_incl')). 2:-expects_dialect(pfc). 3 % loading(always,'examples/Mueller2006/Chapter2/Sleep3.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% agent Nathan
31==> t(agent,nathan).
32
33% fluent Awake(agent)
34 % fluent(awake(agent)).
35==> mpred_prop(awake(agent),fluent).
36==> meta_argtypes(awake(agent)).
37
38% event WakeUp(agent)
39 % event(wakeUp(agent)).
40==> mpred_prop(wakeUp(agent),event).
41==> meta_argtypes(wakeUp(agent)).
42
43% event FallAsleep(agent)
44 % event(fallAsleep(agent)).
45==> mpred_prop(fallAsleep(agent),event).
46==> meta_argtypes(fallAsleep(agent)).
47
48
52 54axiom(initiates(wakeUp(Agent), awake(Agent), Time),
55 []).
56
57
60 61axiom(terminates(fallAsleep(Agent), awake(Agent), Time),
62 []).
63
64
72axiom(requires(wakeUp(Agent), Time),
73 [not(holds_at(awake(Agent), Time))]).
74
75
78axiom(happens(wakeUp(nathan), t),
79 [is_time(0)]).
80
81
84
85
88holds_at(awake(nathan),1).
89
90
91% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter2/Sleep3.e:48
92%; inferred:
93%; !HoldsAt(Awake(Nathan),0).
94
95% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter2/Sleep3.e:51
96% completion Happens
97% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter2/Sleep3.e:52
98==> completion(happens).
99
100% range time 0 1
101% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter2/Sleep3.e:54
102==> range(time,0,1).
103
104% range offset 1 1
105% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2006/Chapter2/Sleep3.e:55
106==> range(offset,1,1).