1:-include(library('ec_planner/ec_test_incl')). 2:-expects_dialect(pfc). 3 % loading(always,'examples/Shanahan1997/DeadOrAlive.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%; \fullciteA[p. 324]{Shanahan:1997}
15%;
16%; @book{Shanahan:1997,
17%; author = "Murray Shanahan",
18%; year = "1997",
19%; title = "Solving the Frame Problem",
20%; address = "Cambridge, MA",
21%; publisher = "MIT Press",
22%; }
23%;
24%; deduction
25%;
26%; modifications from Shanahan's formulation:
27%; InitiallyP -> HoldsAt
28%; timestamps
29%; added [time] Terminates(Shoot(),Loaded(),time).
30%;
31
32% load foundations/Root.e
33
34% load foundations/EC.e
35
36% event Load()
37 % event(load()).
38==> mpred_prop(load(),event).
39==> meta_argtypes(load()).
40
41% event Shoot()
42 % event(shoot()).
43==> mpred_prop(shoot(),event).
44==> meta_argtypes(shoot()).
45
46% event Sneeze()
47 % event(sneeze()).
48==> mpred_prop(sneeze(),event).
49==> meta_argtypes(sneeze()).
50
51% fluent Loaded()
52 % fluent(loaded()).
53==> mpred_prop(loaded(),fluent).
54==> meta_argtypes(loaded()).
55
56% fluent Alive()
57 % fluent(alive()).
58==> mpred_prop(alive(),fluent).
59==> meta_argtypes(alive()).
60
61% fluent Dead()
62 % fluent(dead()).
63==> mpred_prop(dead(),fluent).
64==> meta_argtypes(dead()).
65
66% noninertial Dead
67==> noninertial(dead).
68
69
72 73axiom(initiates(load(), loaded(), Time),
74 []).
75
76
79 80axiom(terminates(shoot(), alive(), Time),
81 [holds_at(loaded(), Time)]).
82
83
86 87axiom(terminates(shoot(), loaded(), Time),
88 []).
89
90
93 94
95 98axiom(holds_at(dead(), Time),
99 [not(holds_at(alive(), Time))]).
100axiom(not(holds_at(alive(), Time)),
101 [holds_at(dead(), Time)]).
102
103
106axiom(initially(alive()),
107 []).
108
109
112 113axiom(not(initially(loaded())),
114 []).
115
116
119axiom(happens(load(), t),
120 [is_time(0)]).
121
122
125axiom(happens(sneeze(), start),
126 [is_time(1), b(t, start), ignore(t+1=start)]).
127
128
131axiom(happens(shoot(), t2),
132 [is_time(2), b(t, t2), ignore(t+2=t2)]).
133
134% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1997/DeadOrAlive.e:50
135% completion Happens
136% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1997/DeadOrAlive.e:51
137==> completion(happens).
138
139% range time 0 3
140% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1997/DeadOrAlive.e:53
141==> range(time,0,3).
142
143% range offset 1 1
144% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1997/DeadOrAlive.e:54
145==> range(offset,1,1).