:-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Baseball.e',157). :- call_pel_directive(translate(unskipped, '/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.pel')). :-include(library('ec_planner/ec_test_incl')). :-expects_dialect(ecalc). :- call_pel_directive(translate(begining, '/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.pel')). %; %; Copyright (c) 2005 IBM Corporation and others. %; All rights reserved. This program and the accompanying materials %; are made available under the terms of the Common Public License v1.0 %; which accompanies this distribution, and is available at %; http://www.eclipse.org/legal/cpl-v10.html %; %; Contributors: %; IBM - Initial implementation %; %; bomb %; agent is nondeterministically killed. % fluent KilledDeterminingFluent(agent) :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.e',13). fluent(killedDeterminingFluent(agent)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.e',15). % noninertial KilledDeterminingFluent :- call_pel_directive(noninertial(killedDeterminingFluent)). %; agent is nondeterministically injured. % fluent InjuredDeterminingFluent(agent) :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.e',17). fluent(injuredDeterminingFluent(agent)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.e',19). % noninertial InjuredDeterminingFluent :- call_pel_directive(noninertial(injuredDeterminingFluent)). %; physobj is nondeterministically destroyed. % fluent DestroyedDeterminingFluent(physobj) :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.e',21). fluent(destroyedDeterminingFluent(physobj)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.e',23). % noninertial DestroyedDeterminingFluent :- call_pel_directive(noninertial(destroyedDeterminingFluent)). %; physobj is nondeterministically damaged. % fluent DamagedDeterminingFluent(physobj) :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.e',25). fluent(damagedDeterminingFluent(physobj)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.e',27). % noninertial DamagedDeterminingFluent :- call_pel_directive(noninertial(damagedDeterminingFluent)). %; agent activates bomb. % event BombActivate(agent,bomb) :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.e',29). event(bombActivate(agent,bomb)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.e',32). %; agent deactivates bomb. % event BombDeactivate(agent,bomb) event(bombDeactivate(agent,bomb)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.e',35). %; bomb explodes. % event BombExplode(bomb) event(bombExplode(bomb)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.e',38). %; bomb is activated. % fluent BombActivated(bomb) fluent(bombActivated(bomb)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.e',41). %; The timer value of bomb is offset. % fluent BombTimerValue(bomb,offset) fluent(bombTimerValue(bomb,offset)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.e',44). %; The timer value of bomb is decremented. % event BombDecrementTimer(bomb) event(bombDecrementTimer(bomb)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.e',47). %; The time delay of bomb is offset. % function BombTimeDelay(bomb): offset function(bombTimeDelay(bomb),offset). %; A state constraint says that a bomb has one timer %; value at a time: % [bomb,offset1,offset2,time] % HoldsAt(BombTimerValue(bomb,offset1),time) & % HoldsAt(BombTimerValue(bomb,offset2),time) -> % offset1=offset2. :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.e',52). holds_at(bombTimerValue(Bomb, Offset1), Time), holds_at(bombTimerValue(Bomb, Offset2), Time) -> Offset1=Offset2. %; An effect axiom states that if a bomb is intact and %; an agent activates the bomb, %; the bomb will be activated: % [agent,bomb,time] % HoldsAt(Intact(bomb),time) -> % Initiates(BombActivate(agent,bomb), % BombActivated(bomb), % time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.e',60). holds_at(intact(Bomb), Time) -> initiates_at(bombActivate(Agent, Bomb), bombActivated(Bomb), Time). %; A precondition axiom states that %; for an agent to activate a bomb, %; the agent must be holding the bomb: % [agent,bomb,time] % Happens(BombActivate(agent,bomb),time) -> % HoldsAt(Holding(agent,bomb),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.e',69). happens_at(bombActivate(Agent, Bomb), Time) -> holds_at(holding(Agent, Bomb), Time). %; An effect axiom states that if a bomb is intact and %; an agent deactivates the bomb, %; the bomb will no longer be activated: % [agent,bomb,time] % HoldsAt(Intact(bomb),time) -> % Terminates(BombDeactivate(agent,bomb), % BombActivated(bomb), % time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.e',76). holds_at(intact(Bomb), Time) -> terminates_at(bombDeactivate(Agent, Bomb), bombActivated(Bomb), Time). %; An axiom states that if a bomb explodes, the %; bomb destroys the bomb: % [bomb,time] % Happens(BombExplode(bomb),time) -> % Happens(Destroy(bomb,bomb),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.e',84). happens_at(bombExplode(Bomb), Time) -> happens_at(destroy(Bomb, Bomb), Time). %; An effect axiom states that if a bomb explodes, %; the bomb is no longer activated: % [bomb,time] % Terminates(BombExplode(bomb),BombActivated(bomb),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.e',90). terminates_at(bombExplode(Bomb), bombActivated(Bomb), Time). %; A trigger axiom states that %; if a bomb is activated, %; the timer value of the bomb is a timer value, and %; the timer value is greater than zero, %; the timer value of the bomb will be decremented: % [bomb,offset,time] % HoldsAt(BombActivated(bomb),time) & % HoldsAt(BombTimerValue(bomb,offset),time) & % (offset > 0) -> % Happens(BombDecrementTimer(bomb),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.e',98). holds_at(bombActivated(Bomb), Time), holds_at(bombTimerValue(Bomb, Offset), Time), Offset>0 -> happens_at(bombDecrementTimer(Bomb), Time). %; An effect axiom states that %; if the timer value of the bomb is a timer value and %; the timer value of the bomb is decremented, %; the timer value of the bomb will be the timer value minus one: % [bomb,offset1,offset2,time] % HoldsAt(BombTimerValue(bomb,offset1),time) & % offset2 = offset1-1 -> % Initiates(BombDecrementTimer(bomb), % BombTimerValue(bomb,offset2), % time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.e',108). holds_at(bombTimerValue(Bomb, Offset1), Time), Offset2=Offset1-1 -> initiates_at(bombDecrementTimer(Bomb), bombTimerValue(Bomb, Offset2), Time). %; An effect axiom states that %; if the timer value of the bomb is a timer value and %; the timer value of the bomb is decremented, %; the timer value of the bomb will no longer be the timer value: % [bomb,offset,time] % HoldsAt(BombTimerValue(bomb,offset),time) -> % Terminates(BombDecrementTimer(bomb), % BombTimerValue(bomb,offset), % time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.e',119). holds_at(bombTimerValue(Bomb, Offset), Time) -> terminates_at(bombDecrementTimer(Bomb), bombTimerValue(Bomb, Offset), Time). %; An effect axiom states that if a bomb explodes, %; the bomb will no longer be activated: % [bomb,time] % Terminates(BombExplode(bomb),BombActivated(bomb),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.e',127). terminates_at(bombExplode(Bomb), bombActivated(Bomb), Time). %; A trigger axiom states that if the timer value %; of a bomb is zero, the bomb will explode: % [bomb,time] % HoldsAt(BombTimerValue(bomb,0),time) -> % Happens(BombExplode(bomb),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.e',132). holds_at(bombTimerValue(Bomb, 0), Time) -> happens_at(bombExplode(Bomb), Time). %; An axiom states that if an agent is at a location, %; a bomb is at the location, %; the agent is nondeterministically injured, and %; the bomb explodes, then %; the bomb will injure the agent: % [agent,location,bomb,time] % HoldsAt(At(agent,location),time) & % HoldsAt(At(bomb,location),time) & % HoldsAt(InjuredDeterminingFluent(agent),time) & % Happens(BombExplode(bomb),time) -> % Happens(Injure(bomb,agent),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.e',141). holds_at(at_loc(Agent, Location), Time), holds_at(at_loc(Bomb, Location), Time), holds_at(injuredDeterminingFluent(Agent), Time), happens_at(bombExplode(Bomb), Time) -> happens_at(injure(Bomb, Agent), Time). %; An axiom states that if an agent is at a location, %; a bomb is at the location, %; the agent is nondeterministically killed, and %; the bomb explodes, then %; the bomb will kill the agent: % [agent,location,bomb,time] % HoldsAt(At(agent,location),time) & % HoldsAt(At(bomb,location),time) & % HoldsAt(KilledDeterminingFluent(agent),time) & % Happens(BombExplode(bomb),time) -> % Happens(Kill(bomb,agent),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.e',153). holds_at(at_loc(Agent, Location), Time), holds_at(at_loc(Bomb, Location), Time), holds_at(killedDeterminingFluent(Agent), Time), happens_at(bombExplode(Bomb), Time) -> happens_at(kill(Bomb, Agent), Time). %; An axiom states that if an physical object is at a location, %; a bomb is at the location, %; the physical object is nondeterministically damaged, and %; the bomb explodes, then %; the bomb will damage the physical object: % [physobj,location,bomb,time] % HoldsAt(At(physobj,location),time) & % HoldsAt(At(bomb,location),time) & % HoldsAt(DamagedDeterminingFluent(physobj),time) & % Happens(BombExplode(bomb),time) -> % Happens(Damage(bomb,physobj),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.e',165). holds_at(at_loc(Physobj, Location), Time), holds_at(at_loc(Bomb, Location), Time), holds_at(damagedDeterminingFluent(Physobj), Time), happens_at(bombExplode(Bomb), Time) -> happens_at(damage(Bomb, Physobj), Time). %; An axiom states that if an physical object is at a location, %; a bomb is at the location, %; the physical object is nondeterministically destroyed, and %; the bomb explodes, then %; the bomb will destroy the physical object: % [physobj,location,bomb,time] % HoldsAt(At(physobj,location),time) & % HoldsAt(At(bomb,location),time) & % HoldsAt(DestroyedDeterminingFluent(physobj),time) & % Happens(BombExplode(bomb),time) -> % Happens(Destroy(bomb,physobj),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.e',177). holds_at(at_loc(Physobj, Location), Time), holds_at(at_loc(Bomb, Location), Time), holds_at(destroyedDeterminingFluent(Physobj), Time), happens_at(bombExplode(Bomb), Time) -> happens_at(destroy(Bomb, Physobj), Time). %; End of file. :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.e',183). :- call_pel_directive(translate(ending, '/pack/logicmoo_ec/ext/ec_sources/ecnet/Bomb.pel')).