1:-include(library('ec_planner/ec_test_incl')). 2:-expects_dialect(pfc). 3 % loading(always,'examples/Mueller2004b/OffOn.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 agent
31==> sort(agent).
32
33% sort switch
34==> sort(switch).
35
36% fluent On(switch)
37 % fluent(on(switch)).
38==> mpred_prop(on(switch),fluent).
39==> meta_argtypes(on(switch)).
40
41% fluent Off(switch)
42 % fluent(off(switch)).
43==> mpred_prop(off(switch),fluent).
44==> meta_argtypes(off(switch)).
45
46% event TurnOn(agent,switch)
47 % event(turnOn(agent,switch)).
48==> mpred_prop(turnOn(agent,switch),event).
49==> meta_argtypes(turnOn(agent,switch)).
50
51% event TurnOff(agent,switch)
52 % event(turnOff(agent,switch)).
53==> mpred_prop(turnOff(agent,switch),event).
54==> meta_argtypes(turnOff(agent,switch)).
55
56% noninertial Off
57==> noninertial(off).
58
59
62 63
64 67axiom(holds_at(off(Switch), Time),
68 [not(holds_at(on(Switch), Time))]).
69axiom(not(holds_at(on(Switch), Time)),
70 [holds_at(off(Switch), Time)]).
71
72
75 76axiom(initiates(turnOn(Agent, Switch), on(Switch), Time),
77 []).
78
79
82 83axiom(terminates(turnOff(Agent, Switch), on(Switch), Time),
84 []).
85
86% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2004b/OffOn.e:40
87% agent James
88% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2004b/OffOn.e:41
89==> t(agent,james).
90
91% switch Switch1
92% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2004b/OffOn.e:42
93==> t(switch,switch1).
94
95
98 99axiom(not(initially(on(switch1))),
100 []).
101
102
105axiom(happens(turnOn(james, switch1), t),
106 [is_time(0)]).
107
108% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2004b/OffOn.e:46
109% range time 0 1
110% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2004b/OffOn.e:47
111==> range(time,0,1).
112
113% range offset 1 1
114% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/examples/Mueller2004b/OffOn.e:48
115==> range(offset,1,1).