1:-include(library('ec_planner/ec_test_incl')). 2:-expects_dialect(pfc). 3 % loading(always,'examples/Mueller2004b/Approve.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%; example of concurrent events with cumulative or canceling effects
15%;
16%; @inproceedings{Mueller:2004b,
17%; author = "Erik T. Mueller",
18%; year = "2004",
19%; title = "A tool for satisfiability-based commonsense reasoning in the event calculus",
20%; editor = "Valerie Barr and Zdravko Markov",
21%; 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",
22%; pages = "147--152",
23%; address = "Menlo Park, CA",
24%; publisher = "AAAI Press",
25%; }
26%;
27
28% load foundations/Root.e
29
30% load foundations/EC.e
31
32% sort agent
33==> sort(agent).
34
35% event ApproveOf(agent,agent)
36 % event(approveOf(agent,agent)).
37==> mpred_prop(approveOf(agent,agent),event).
38==> meta_argtypes(approveOf(agent,agent)).
39
40% event DisapproveOf(agent,agent)
41 % event(disapproveOf(agent,agent)).
42==> mpred_prop(disapproveOf(agent,agent),event).
43==> meta_argtypes(disapproveOf(agent,agent)).
44
45% fluent Happy(agent)
46 % fluent(happy(agent)).
47==> mpred_prop(happy(agent),fluent).
48==> meta_argtypes(happy(agent)).
49
50% fluent Confused(agent)
51 % fluent(confused(agent)).
52==> mpred_prop(confused(agent),fluent).
53==> meta_argtypes(confused(agent)).
54
55
61axiom(initiates(approveOf(Agent1, Agent2), happy(Agent2), Time),
62 [not(happens(disapproveOf(Agent1, Agent2), Time))]).
63
64
70axiom(terminates(disapproveOf(Agent1, Agent2), happy(Agent2), Time),
71 [not(happens(approveOf(Agent1, Agent2), Time))]).
72
73
79axiom(requires(disapproveOf(Agent1, Agent2), Time),
80
81 [ initiates(approveOf(Agent1, Agent2),
82 confused(Agent2),
83 Time)
84 ]).
85
86% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2004b/Approve.e:46
87% agent James, Peter
88% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2004b/Approve.e:47
89==> t(agent,james).
90==> t(agent,peter).
91
92
95 96
97 100axiom(not(holds_at(happy(Happy_Ret), t)),
101 []).
102axiom(not(holds_at(confused(Confused_Ret), t)),
103 []).
104
105
108axiom(happens(approveOf(peter, james), t),
109 [is_time(0)]).
110
111
114axiom(happens(disapproveOf(peter, james), t),
115 [is_time(0)]).
116
117% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2004b/Approve.e:53
118% completion Happens
119% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2004b/Approve.e:54
120==> completion(happens).
121
122% range time 0 1
123% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2004b/Approve.e:56
124==> range(time,0,1).
125
126% range offset 1 1
127% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2004b/Approve.e:57
128==> range(offset,1,1).