1:-include(library('ec_planner/ec_test_incl')). 2:-expects_dialect(pfc). 3 % loading(always,'ecnet/Bomb.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%; bomb 15%; agent is nondeterministically killed. 16 17% fluent KilledDeterminingFluent(agent) 18 % fluent(killedDeterminingFluent(agent)). 19==> mpred_prop(killedDeterminingFluent(agent),fluent). 20==> meta_argtypes(killedDeterminingFluent(agent)). 21 22% noninertial KilledDeterminingFluent 23==> noninertial(killedDeterminingFluent). 24%; agent is nondeterministically injured. 25 26% fluent InjuredDeterminingFluent(agent) 27 % fluent(injuredDeterminingFluent(agent)). 28==> mpred_prop(injuredDeterminingFluent(agent),fluent). 29==> meta_argtypes(injuredDeterminingFluent(agent)). 30 31% noninertial InjuredDeterminingFluent 32==> noninertial(injuredDeterminingFluent). 33%; physobj is nondeterministically destroyed. 34 35% fluent DestroyedDeterminingFluent(physobj) 36 % fluent(destroyedDeterminingFluent(physobj)). 37==> mpred_prop(destroyedDeterminingFluent(physobj),fluent). 38==> meta_argtypes(destroyedDeterminingFluent(physobj)). 39 40% noninertial DestroyedDeterminingFluent 41==> noninertial(destroyedDeterminingFluent). 42%; physobj is nondeterministically damaged. 43 44% fluent DamagedDeterminingFluent(physobj) 45 % fluent(damagedDeterminingFluent(physobj)). 46==> mpred_prop(damagedDeterminingFluent(physobj),fluent). 47==> meta_argtypes(damagedDeterminingFluent(physobj)). 48 49% noninertial DamagedDeterminingFluent 50==> noninertial(damagedDeterminingFluent). 51%; agent activates bomb. 52 53% event BombActivate(agent,bomb) 54 % event(bombActivate(agent,bomb)). 55==> mpred_prop(bombActivate(agent,bomb),event). 56==> meta_argtypes(bombActivate(agent,bomb)). 57 58 59% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:31 60%; agent deactivates bomb. 61 62% event BombDeactivate(agent,bomb) 63 % event(bombDeactivate(agent,bomb)). 64% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:33 65==> mpred_prop(bombDeactivate(agent,bomb),event). 66==> meta_argtypes(bombDeactivate(agent,bomb)). 67 68 69% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:34 70%; bomb explodes. 71 72% event BombExplode(bomb) 73 % event(bombExplode(bomb)). 74% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:36 75==> mpred_prop(bombExplode(bomb),event). 76==> meta_argtypes(bombExplode(bomb)). 77 78 79% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:37 80%; bomb is activated. 81 82% fluent BombActivated(bomb) 83 % fluent(bombActivated(bomb)). 84% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:39 85==> mpred_prop(bombActivated(bomb),fluent). 86==> meta_argtypes(bombActivated(bomb)). 87 88 89% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:40 90%; The timer value of bomb is offset. 91 92% fluent BombTimerValue(bomb,offset) 93 % fluent(bombTimerValue(bomb,offset)). 94% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:42 95==> mpred_prop(bombTimerValue(bomb,offset),fluent). 96==> meta_argtypes(bombTimerValue(bomb,offset)). 97 98 99% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:43 100%; The timer value of bomb is decremented. 101 102% event BombDecrementTimer(bomb) 103 % event(bombDecrementTimer(bomb)). 104% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:45 105==> mpred_prop(bombDecrementTimer(bomb),event). 106==> meta_argtypes(bombDecrementTimer(bomb)). 107 108 109% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:46 110%; The time delay of bomb is offset. 111 112% function BombTimeDelay(bomb): offset 113 % functional_predicate(bombTimeDelay(bomb,offset)). 114% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:48 115==> mpred_prop(bombTimeDelay(bomb,offset),functional_predicate). 116==> meta_argtypes(bombTimeDelay(bomb,offset)). 117resultIsa(bombTimeDelay,offset). 118%; A state constraint says that a bomb has one timer 119%; value at a time: 120% [bomb,offset1,offset2,time] 121% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:52 122% HoldsAt(BombTimerValue(bomb,offset1),time) & 123% HoldsAt(BombTimerValue(bomb,offset2),time) -> 124% offset1=offset2. 125% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:54 126axiom(Offset1=Offset2, 127 128 [ holds_at(bombTimerValue(Bomb, Offset1), Time), 129 holds_at(bombTimerValue(Bomb, Offset2), Time) 130 ]). 131 132 133% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:56 134%; An effect axiom states that if a bomb is intact and 135%; an agent activates the bomb, 136%; the bomb will be activated: 137% [agent,bomb,time] 138% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:60 139% HoldsAt(Intact(bomb),time) -> 140% Initiates(BombActivate(agent,bomb), 141% BombActivated(bomb), 142% time). 143% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:63 144axiom(initiates(bombActivate(Agent, Bomb), bombActivated(Bomb), Time), 145 [holds_at(intact(Bomb), Time)]). 146 147 148% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:65 149%; A precondition axiom states that 150%; for an agent to activate a bomb, 151%; the agent must be holding the bomb: 152% [agent,bomb,time] 153% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:69 154% Happens(BombActivate(agent,bomb),time) -> 155% HoldsAt(Holding(agent,bomb),time). 156% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:70 157axiom(requires(bombActivate(Agent, Bomb), Time), 158 [holds_at(holding(Agent, Bomb), Time)]). 159 160 161% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:72 162%; An effect axiom states that if a bomb is intact and 163%; an agent deactivates the bomb, 164%; the bomb will no longer be activated: 165% [agent,bomb,time] 166% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:76 167% HoldsAt(Intact(bomb),time) -> 168% Terminates(BombDeactivate(agent,bomb), 169% BombActivated(bomb), 170% time). 171% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:79 172axiom(terminates(bombDeactivate(Agent, Bomb), bombActivated(Bomb), Time), 173 [holds_at(intact(Bomb), Time)]). 174 175 176% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:81 177%; An axiom states that if a bomb explodes, the 178%; bomb destroys the bomb: 179% [bomb,time] 180% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:84 181% Happens(BombExplode(bomb),time) -> 182% Happens(Destroy(bomb,bomb),time). 183% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:85 184axiom(happens(destroy(Bomb, Bomb), Time), 185 [happens(bombExplode(Bomb), Time)]). 186 187 188% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:87 189%; An effect axiom states that if a bomb explodes, 190%; the bomb is no longer activated: 191% [bomb,time] 192% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:90 193% Terminates(BombExplode(bomb),BombActivated(bomb),time). 194axiom(terminates(bombExplode(Bomb), bombActivated(Bomb), Time), 195 []). 196 197 198% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:92 199%; A trigger axiom states that 200%; if a bomb is activated, 201%; the timer value of the bomb is a timer value, and 202%; the timer value is greater than zero, 203%; the timer value of the bomb will be decremented: 204% [bomb,offset,time] 205% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:98 206% HoldsAt(BombActivated(bomb),time) & 207% HoldsAt(BombTimerValue(bomb,offset),time) & 208% (offset > 0) -> 209% Happens(BombDecrementTimer(bomb),time). 210% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:101 211axiom(happens(bombDecrementTimer(Bomb), Time), 212 213 [ holds_at(bombActivated(Bomb), Time), 214 holds_at(bombTimerValue(Bomb, Offset), Time), 215 comparison(Offset, 0, >) 216 ]). 217 218 219% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:103 220%; An effect axiom states that 221%; if the timer value of the bomb is a timer value and 222%; the timer value of the bomb is decremented, 223%; the timer value of the bomb will be the timer value minus one: 224% [bomb,offset1,offset2,time] 225% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:108 226% HoldsAt(BombTimerValue(bomb,offset1),time) & 227% offset2 = offset1-1 -> 228% Initiates(BombDecrementTimer(bomb), 229% BombTimerValue(bomb,offset2), 230% time). 231% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:112 232axiom(initiates(bombDecrementTimer(Bomb), bombTimerValue(Bomb, Offset2), Time), 233 234 [ holds_at(bombTimerValue(Bomb, Offset1), Time), 235 equals(Offset2, Offset1-1) 236 ]). 237 238 239% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:114 240%; An effect axiom states that 241%; if the timer value of the bomb is a timer value and 242%; the timer value of the bomb is decremented, 243%; the timer value of the bomb will no longer be the timer value: 244% [bomb,offset,time] 245% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:119 246% HoldsAt(BombTimerValue(bomb,offset),time) -> 247% Terminates(BombDecrementTimer(bomb), 248% BombTimerValue(bomb,offset), 249% time). 250% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:122 251axiom(terminates(bombDecrementTimer(Bomb), bombTimerValue(Bomb, Offset), Time), 252 [holds_at(bombTimerValue(Bomb, Offset), Time)]). 253 254 255% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:124 256%; An effect axiom states that if a bomb explodes, 257%; the bomb will no longer be activated: 258% [bomb,time] 259% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:127 260% Terminates(BombExplode(bomb),BombActivated(bomb),time). 261axiom(terminates(bombExplode(Bomb), bombActivated(Bomb), Time), 262 []). 263 264 265% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:129 266%; A trigger axiom states that if the timer value 267%; of a bomb is zero, the bomb will explode: 268% [bomb,time] 269% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:132 270% HoldsAt(BombTimerValue(bomb,0),time) -> 271% Happens(BombExplode(bomb),time). 272% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:133 273axiom(happens(bombExplode(Bomb), Time), 274 [holds_at(bombTimerValue(Bomb, 0), Time)]). 275 276 277% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:135 278%; An axiom states that if an agent is at a location, 279%; a bomb is at the location, 280%; the agent is nondeterministically injured, and 281%; the bomb explodes, then 282%; the bomb will injure the agent: 283% [agent,location,bomb,time] 284% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:141 285% HoldsAt(At(agent,location),time) & 286% HoldsAt(At(bomb,location),time) & 287% HoldsAt(InjuredDeterminingFluent(agent),time) & 288% Happens(BombExplode(bomb),time) -> 289% Happens(Injure(bomb,agent),time). 290% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:145 291axiom(happens(injure(Bomb, Agent), Time), 292 293 [ holds_at(at(Agent, Location), Time), 294 holds_at(at(Bomb, Location), Time), 295 holds_at(injuredDeterminingFluent(Agent), Time), 296 happens(bombExplode(Bomb), Time) 297 ]). 298 299 300% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:147 301%; An axiom states that if an agent is at a location, 302%; a bomb is at the location, 303%; the agent is nondeterministically killed, and 304%; the bomb explodes, then 305%; the bomb will kill the agent: 306% [agent,location,bomb,time] 307% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:153 308% HoldsAt(At(agent,location),time) & 309% HoldsAt(At(bomb,location),time) & 310% HoldsAt(KilledDeterminingFluent(agent),time) & 311% Happens(BombExplode(bomb),time) -> 312% Happens(Kill(bomb,agent),time). 313% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:157 314axiom(happens(kill(Bomb, Agent), Time), 315 316 [ holds_at(at(Agent, Location), Time), 317 holds_at(at(Bomb, Location), Time), 318 holds_at(killedDeterminingFluent(Agent), Time), 319 happens(bombExplode(Bomb), Time) 320 ]). 321 322 323% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:159 324%; An axiom states that if an physical object is at a location, 325%; a bomb is at the location, 326%; the physical object is nondeterministically damaged, and 327%; the bomb explodes, then 328%; the bomb will damage the physical object: 329% [physobj,location,bomb,time] 330% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:165 331% HoldsAt(At(physobj,location),time) & 332% HoldsAt(At(bomb,location),time) & 333% HoldsAt(DamagedDeterminingFluent(physobj),time) & 334% Happens(BombExplode(bomb),time) -> 335% Happens(Damage(bomb,physobj),time). 336% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:169 337axiom(happens(damage(Bomb, Physobj), Time), 338 339 [ holds_at(at(Physobj, Location), Time), 340 holds_at(at(Bomb, Location), Time), 341 holds_at(damagedDeterminingFluent(Physobj), Time), 342 happens(bombExplode(Bomb), Time) 343 ]). 344 345 346% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:171 347%; An axiom states that if an physical object is at a location, 348%; a bomb is at the location, 349%; the physical object is nondeterministically destroyed, and 350%; the bomb explodes, then 351%; the bomb will destroy the physical object: 352% [physobj,location,bomb,time] 353% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:177 354% HoldsAt(At(physobj,location),time) & 355% HoldsAt(At(bomb,location),time) & 356% HoldsAt(DestroyedDeterminingFluent(physobj),time) & 357% Happens(BombExplode(bomb),time) -> 358% Happens(Destroy(bomb,physobj),time). 359% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:181 360axiom(happens(destroy(Bomb, Physobj), Time), 361 362 [ holds_at(at(Physobj, Location), Time), 363 holds_at(at(Bomb, Location), Time), 364 holds_at(destroyedDeterminingFluent(Physobj), Time), 365 happens(bombExplode(Bomb), Time) 366 ]). 367 368 369% From /opt/logicmoo_workspace/packs_sys/small_adventure_games/prolog/ec_planner/ecnet/Bomb.e:183 370%; End of file.