:-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/OTSpace.e',481). :- call_pel_directive(translate(unskipped, '/pack/logicmoo_ec/ext/ec_sources/ecnet/PlayNeed.pel')). :-include(library('ec_planner/ec_test_incl')). :-expects_dialect(ecalc). :- call_pel_directive(translate(begining, '/pack/logicmoo_ec/ext/ec_sources/ecnet/PlayNeed.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 %; %; A complete story understanding program will require representations %; of common human needs \fullcite{SchankAbelson:1977}. %; %; @book{SchankAbelson:1977, %; author = "Schank, Roger C. and Abelson, Robert P.", %; year = "1977", %; title = "Scripts, Plans, Goals, and Understanding: An Inquiry into Human Knowledge Structures", %; address = "Hillsdale, NJ", %; publisher = "Lawrence Erlbaum", %; } %; %; The PlayNeed representation deals with one type of need, the need %; to play. %; Our underlying theory of human needs consists of the following sequence: %; (1) A need is unsatisfied. %; (2) Given certain stimuli and an unsatisfied need, an intention %; to satisfy the need is activated. %; (3) The intention is acted upon. %; (4) The need is satisfied. %; agent has an unsatisfied need to play. % fluent HungryToPlay(agent) :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/PlayNeed.e',32). fluent(hungryToPlay(agent)). %; agent has the intention to play outside. :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/PlayNeed.e',35). % fluent IntentionToPlay(agent,outside) fluent(intentionToPlay(agent,outside)). %; agent has a satisfied need to play. :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/PlayNeed.e',37). % fluent SatiatedFromPlay(agent) fluent(satiatedFromPlay(agent)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/PlayNeed.e',39). %; At any time, an agent is in one of three states with respect %; to the need to play: :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/PlayNeed.e',41). % xor HungryToPlay, IntentionToPlay, SatiatedFromPlay xor([hungryToPlay,intentionToPlay,satiatedFromPlay]). %; agent intends to play at location outside. % event IntendToPlay(agent,outside) :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/PlayNeed.e',43). event(intendToPlay(agent,outside)). %; agent plays at location outside. :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/PlayNeed.e',46). % event Play(agent,outside) event(play(agent,outside)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/PlayNeed.e',48). %; agent acts on the intention to play outside. % fluent ActOnIntentionToPlay(agent,outside) fluent(actOnIntentionToPlay(agent,outside)). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/PlayNeed.e',50). % noninertial ActOnIntentionToPlay :- call_pel_directive(noninertial(actOnIntentionToPlay)). %; A trigger axiom activates an intention for an agent to play when %; the agent has an unsatisfied need for play, the agent likes snow, %; the agent is awake, and %; the agent is in a room that looks out onto an outside area where it %; is snowing: % [agent,room,outside,time] % HoldsAt(HungryToPlay(agent),time) & % HoldsAt(LikeSnow(agent),time) & % HoldsAt(At(agent,room),time) & % LookOutOnto(room)=outside & % HoldsAt(Awake(agent),time) & % HoldsAt(Snowing(outside),time) -> % Happens(IntendToPlay(agent,outside),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/PlayNeed.e',57). holds_at(hungryToPlay(Agent), Time), holds_at(likeSnow(Agent), Time), holds_at(at_loc(Agent, Room), Time), lookOutOnto(Room)=Outside, holds_at(awake(Agent), Time), holds_at(snowing(Outside), Time) -> happens_at(intendToPlay(Agent, Outside), Time). %; A story understanding program will need a detailed representation %; of intention \fullcite{CohenLevesque:1990}. %; %; @article{CohenLevesque:1990, %; author = "Philip R. Cohen and Hector J. Levesque", %; year = "1990", %; title = "Intention is choice with commitment", %; journal = "Artificial Intelligence", %; volume = "42", %; pages = "213--261", %; } %; %; In our simplified representation, once an intention to %; perform $e$ is activated, it persists until it is acted %; upon. Intentions are represented by inertial fluents. %; If an intention to perform $e$ is active at time point $t$, %; the agent may or may not perform $e$ at time point $t$. %; That is, we do not know exactly when the agent will act on the %; intention. %; This is a case of nondeterminism, %; which we handle by introducing a noninertial fluent corresponding %; to each intention fluent that %; indicates whether the agent does or does not in fact act %; on an intention at a given time. %; Since each ground term of the new noninertial fluent multiplies the %; number of models by $2^{n}$ where $n$ is the number of time points, %; in practice we may constrain the truth value of the fluent %; at various time points. %; In the case of the need to play, %; HoldsAt(ActOnIntentionToPlay(agent, outside), time) %; represents that %; HoldsAt(IntentionToPlay(agent, outside), time) is acted %; upon at time. %; Effect axioms state that %; if an agent intends to play in an outside area, %; the agent will have an intention to play in the outside area %; and will no longer be in the hungry-to-play state: % [agent,outside,time] % Initiates(IntendToPlay(agent,outside),IntentionToPlay(agent,outside),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/PlayNeed.e',104). initiates_at(intendToPlay(Agent,Outside), intentionToPlay(Agent,Outside), Time). % [agent,outside,time] % Terminates(IntendToPlay(agent,outside),HungryToPlay(agent),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/PlayNeed.e',108). terminates_at(intendToPlay(Agent,Outside), hungryToPlay(Agent), Time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/PlayNeed.e',110). %; A trigger axiom states that if an agent has the intention %; to play in an outside area, %; the agent acts on the intention to play in the outside area, and %; the agent is at the outside area, %; the agent plays in the outside area: % [agent,outside,time] % HoldsAt(IntentionToPlay(agent,outside),time) & % HoldsAt(ActOnIntentionToPlay(agent,outside),time) & % HoldsAt(At(agent,outside),time) -> % Happens(Play(agent,outside),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/PlayNeed.e',115). holds_at(intentionToPlay(Agent, Outside), Time), holds_at(actOnIntentionToPlay(Agent, Outside), Time), holds_at(at_loc(Agent, Outside), Time) -> happens_at(play(Agent, Outside), Time). %; Effect axioms state that if an agent plays in an %; outside area, the agent will be satiated from play %; and will no longer have an intention to play in %; the outside area: % [agent,outside,time] % Initiates(Play(agent,outside),SatiatedFromPlay(agent),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/PlayNeed.e',125). initiates_at(play(Agent,Outside), satiatedFromPlay(Agent), Time). % [agent,outside,time] % Terminates(Play(agent,outside),IntentionToPlay(agent,outside),time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/PlayNeed.e',129). terminates_at(play(Agent,Outside), intentionToPlay(Agent,Outside), Time). :-was_s_l('/pack/logicmoo_ec/ext/ec_sources/ecnet/PlayNeed.e',131). %; End of file. :- call_pel_directive(translate(ending, '/pack/logicmoo_ec/ext/ec_sources/ecnet/PlayNeed.pel')).