:-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/GSpace.e',70). :- call_pel_directive(translate(unskipped, '/pack/logicmoo_ec/ext/ec_sources/ecnet/Gun.pel')). :-include(library('ec_planner/ec_test_incl')). :-expects_dialect(ecalc). :- call_pel_directive(translate(begining, '/pack/logicmoo_ec/ext/ec_sources/ecnet/Gun.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 %; :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Gun.e',12). % fluent Loaded(gun,bullet) fluent(loaded(gun,bullet)). % noninertial Loaded :- call_pel_directive(noninertial(loaded)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Gun.e',15). % [gun,bullet,time] % HoldsAt(Inside(bullet,gun),time) <-> % HoldsAt(Loaded(gun,bullet),time). holds_at(inside(Bullet, Gun), Time) <-> holds_at(loaded(Gun, Bullet), Time). % event Shoot(agent,gun,object) :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Gun.e',18). event(shoot(agent,gun,object)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Gun.e',21). % event ShootInjure(agent,gun,agent) event(shootInjure(agent,gun,agent)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Gun.e',23). % event ShootKill(agent,gun,agent) event(shootKill(agent,gun,agent)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Gun.e',25). % event ShootDamage(agent,gun,physobj) event(shootDamage(agent,gun,physobj)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Gun.e',27). % event ShootDestroy(agent,gun,physobj) event(shootDestroy(agent,gun,physobj)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Gun.e',29). % [agent,gun,bullet,object,time] % HoldsAt(Inside(bullet,gun),time) -> % Terminates(Shoot(agent,gun,object), % Inside(bullet,gun), % time). holds_at(inside(Bullet, Gun), Time) -> terminates_at(shoot(Agent, Gun, Object), inside(Bullet, Gun), Time). % [agent,gun,bullet,object,location1,location2,time] % HoldsAt(Inside(bullet,gun),time) & % HoldsAt(At(gun,location1),time) & % location1 != location2 -> % Terminates(Shoot(agent,gun,object),At(bullet,location2),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Gun.e',36). holds_at(inside(Bullet, Gun), Time), holds_at(at_loc(Gun, Location1), Time), Location1\=Location2 -> terminates_at(shoot(Agent, Gun, Object), at_loc(Bullet, Location2), Time). % [agent,gun,bullet,object,location,time] % HoldsAt(At(object,location),time) & % HoldsAt(Inside(bullet,gun),time) -> % Initiates(Shoot(agent,gun,object),At(bullet,location),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Gun.e',42). holds_at(at_loc(Object, Location), Time), holds_at(inside(Bullet, Gun), Time) -> initiates_at(shoot(Agent, Gun, Object), at_loc(Bullet, Location), Time). % [agent,gun,object,time] % Happens(Shoot(agent,gun,object),time) -> % HoldsAt(Holding(agent,gun),time) & % ({bullet} HoldsAt(Loaded(gun,bullet),time)) & % ({location} HoldsAt(At(agent,location),time) & % HoldsAt(At(object,location),time)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Gun.e',47). happens_at(shoot(Agent, Gun, Object), Time) -> holds_at(holding(Agent, Gun), Time), exists([Bullet], holds_at(loaded(Gun, Bullet), Time)), exists([Location], (holds_at(at_loc(Agent, Location), Time), holds_at(at_loc(Object, Location), Time))). % [agent1,gun,agent2,time] % Happens(Shoot(agent1,gun,agent2),time) -> % Happens(ShootInjure(agent1,gun,agent2),time) | % Happens(ShootKill(agent1,gun,agent2),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Gun.e',54). happens_at(shoot(Agent1, Gun, Agent2), Time) -> ( happens_at(shootInjure(Agent1, Gun, Agent2), Time) ; happens_at(shootKill(Agent1, Gun, Agent2), Time) ). % [agent1,gun,bullet,agent2,time] % HoldsAt(Inside(bullet,gun),time) & % Happens(ShootKill(agent1,gun,agent2),time) -> % Happens(Kill(bullet,agent2),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Gun.e',59). holds_at(inside(Bullet, Gun), Time), happens_at(shootKill(Agent1, Gun, Agent2), Time) -> happens_at(kill(Bullet, Agent2), Time). % [agent1,gun,bullet,agent2,time] % HoldsAt(Inside(bullet,gun),time) & % Happens(ShootInjure(agent1,gun,agent2),time) -> % Happens(Injure(bullet,agent2),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Gun.e',64). holds_at(inside(Bullet, Gun), Time), happens_at(shootInjure(Agent1, Gun, Agent2), Time) -> happens_at(injure(Bullet, Agent2), Time). % [agent,gun,physobj,time] % Happens(Shoot(agent,gun,physobj),time) -> % Happens(ShootDamage(agent,gun,physobj),time) | % Happens(ShootDestroy(agent,gun,physobj),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Gun.e',69). happens_at(shoot(Agent, Gun, Physobj), Time) -> ( happens_at(shootDamage(Agent, Gun, Physobj), Time) ; happens_at(shootDestroy(Agent, Gun, Physobj), Time) ). % [agent,gun,bullet,physobj,time] % HoldsAt(Inside(bullet,gun),time) & % Happens(ShootDamage(agent,gun,physobj),time) -> % Happens(Damage(bullet,physobj),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Gun.e',74). holds_at(inside(Bullet, Gun), Time), happens_at(shootDamage(Agent, Gun, Physobj), Time) -> happens_at(damage(Bullet, Physobj), Time). % [agent,gun,bullet,physobj,time] % HoldsAt(Inside(bullet,gun),time) & % Happens(ShootDestroy(agent,gun,physobj),time) -> % Happens(Destroy(bullet,physobj),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Gun.e',79). holds_at(inside(Bullet, Gun), Time), happens_at(shootDestroy(Agent, Gun, Physobj), Time) -> happens_at(destroy(Bullet, Physobj), Time). %; End of file. :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/Gun.e',82). :- call_pel_directive(translate(ending, '/pack/logicmoo_ec/ext/ec_sources/ecnet/Gun.pel')).