1:-include(library('ec_planner/ec_test_incl')). 2:-expects_dialect(pfc). 3 % loading(always,'examples/Mueller2004b/RouletteWheel.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%; @inproceedings{Mueller:2004b,
15%; author = "Erik T. Mueller",
16%; year = "2004",
17%; title = "A tool for satisfiability-based commonsense reasoning in the event calculus",
18%; editor = "Valerie Barr and Zdravko Markov",
19%; booktitle = "\uppercase{P}roceedings of the \uppercase{S}eventeenth \uppercase{I}nternational \uppercase{F}lorida \uppercase{A}rtificial \uppercase{I}ntelligence \uppercase{R}esearch \uppercase{S}ociety \uppercase{C}onference",
20%; pages = "147--152",
21%; address = "Menlo Park, CA",
22%; publisher = "AAAI Press",
23%; }
24%;
25
26% load foundations/Root.e
27
28% load foundations/EC.e
29
30% sort wheel
31==> sort(wheel).
32
33% sort value: integer
34==> subsort(value,integer).
35
36% fluent WheelValueDeterminingFluent(wheel,value)
37 % fluent(wheelValueDeterminingFluent(wheel,value)).
38==> mpred_prop(wheelValueDeterminingFluent(wheel,value),fluent).
39==> meta_argtypes(wheelValueDeterminingFluent(wheel,value)).
40
41% fluent WheelValue(wheel,value)
42 % fluent(wheelValue(wheel,value)).
43==> mpred_prop(wheelValue(wheel,value),fluent).
44==> meta_argtypes(wheelValue(wheel,value)).
45
46% noninertial WheelValueDeterminingFluent
47==> noninertial(wheelValueDeterminingFluent).
48
49% event Spin(wheel)
50 % event(spin(wheel)).
51==> mpred_prop(spin(wheel),event).
52==> meta_argtypes(spin(wheel)).
53
54
61axiom(Value1=Value2,
62
63 [ holds_at(wheelValue(Wheel, Value1), Time),
64 holds_at(wheelValue(Wheel, Value2), Time)
65 ]).
66
67
74axiom(Value1=Value2,
75
76 [ holds_at(wheelValueDeterminingFluent(Wheel, Value1),
77 Time),
78 holds_at(wheelValueDeterminingFluent(Wheel, Value2),
79 Time)
80 ]).
81
82
88axiom(initiates(spin(Wheel), wheelValue(Wheel, Value), Time),
89
90 [ holds_at(wheelValueDeterminingFluent(Wheel, Value),
91 Time)
92 ]).
93
94
102axiom(terminates(spin(Wheel), wheelValue(Wheel, Value1), Time),
103
104 [ holds_at(wheelValue(Wheel, Value1), Time),
105 holds_at(wheelValueDeterminingFluent(Wheel, Value2),
106 Time),
107 { dif(Value1, Value2)
108 }
109 ]).
110
111
116
117 121
122 126axiom(holds_at(wheelValueDeterminingFluent(WheelValueDeterminingFluent_Param, Some_Param), Time4),
127
128 [ some(Some_Param,
129 '$kolem_Fn_124'(WheelValueDeterminingFluent_Param, Time4))
130 ]).
131
132 137axiom(not(some(Some_Param8, '$kolem_Fn_124'(Fn_124_Param, Time7))),
138
139 [ not(holds_at(wheelValueDeterminingFluent(Fn_124_Param,
140 Some_Param8),
141 Time7))
142 ]).
143
144% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2004b/RouletteWheel.e:56
145% wheel Wheel
146% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2004b/RouletteWheel.e:57
147==> t(wheel,wheel).
148
149
152axiom(initially(wheelValue(wheel, 7)),
153 []).
154
155
158axiom(happens(spin(wheel), t),
159 [is_time(0)]).
160
161
164holds_at(wheelValueDeterminingFluent(wheel,7),1).
165
166% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2004b/RouletteWheel.e:62
167% completion Happens
168% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2004b/RouletteWheel.e:63
169==> completion(happens).
170
171% range value 7 10
172% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2004b/RouletteWheel.e:65
173==> range(value,7,10).
174
175% range time 0 1
176% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2004b/RouletteWheel.e:66
177==> range(time,0,1).
178
179% range offset 1 1
180% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2004b/RouletteWheel.e:67
181==> range(offset,1,1).