1:-include(library('ec_planner/ec_test_incl')). 2:-expects_dialect(pfc). 3 % loading(always,'examples/Shanahan1999/CoinToss.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%; @article{Kartha:1994,
15%; author = "G. Neelakantan Kartha",
16%; year = "1994",
17%; title = "Two counterexamples related to \uppercase{B}aker's approach to the frame problem",
18%; journal = "Artificial Intelligence",
19%; volume = "69",
20%; number = "1--2",
21%; pages = "379--391",
22%; }
23%;
24%; @incollection{Shanahan:1999,
25%; author = "Shanahan, Murray",
26%; year = "1999",
27%; title = "The Event Calculus explained",
28%; editor = "Michael J. Wooldridge and Manuela M. Veloso",
29%; booktitle = "Artificial Intelligence Today: Recent Trends and Developments",
30%; series = "Lecture Notes in Computer Science",
31%; volume = "1600",
32%; pages = "409--430",
33%; address = "Berlin",
34%; publisher = "Springer",
35%; }
36%;
37%; model finding
38%;
39%; modifications from Shanahan's formulation:
40%; InitiallyP -> HoldsAt
41%; pruning of models irrelevant to example
42%; timestamps
43%;
44
45% load foundations/Root.e
46
47% load foundations/EC.e
48
49% event Toss()
50 % event(toss()).
51==> mpred_prop(toss(),event).
52==> meta_argtypes(toss()).
53
54% fluent ItsHeads()
55 % fluent(itsHeads()).
56==> mpred_prop(itsHeads(),fluent).
57==> meta_argtypes(itsHeads()).
58
59% fluent Heads()
60 % fluent(heads()).
61==> mpred_prop(heads(),fluent).
62==> meta_argtypes(heads()).
63
64% noninertial ItsHeads
65==> noninertial(itsHeads).
66
67
70 71axiom(initiates(toss(), heads(), Time),
72 [holds_at(itsHeads(), Time)]).
73
74
77 78axiom(terminates(toss(), heads(), Time),
79 [not(holds_at(itsHeads(), Time))]).
80
81
84axiom(initially(heads()),
85 []).
86
87
90axiom(happens(toss(), start),
91 [is_time(1), b(t, start), ignore(t+1=start)]).
92
93
96axiom(happens(toss(), t2),
97 [is_time(2), b(t, t2), ignore(t+2=t2)]).
98
99
102axiom(happens(toss(), t3),
103 [is_time(3), b(t, t3), ignore(t+3=t3)]).
104
105
108
109
112axiom(initially(itsHeads()),
113 []).
114
115
118holds_at(itsHeads(),4).
119
120% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/CoinToss.e:61
121% completion Happens
122% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/CoinToss.e:62
123==> completion(happens).
124
125% range time 0 4
126% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/CoinToss.e:64
127==> range(time,0,4).
128
129% range offset 1 1
130% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Shanahan1999/CoinToss.e:65
131==> range(offset,1,1).