Package jason.stdlib

Class intention

All Implemented Interfaces:
InternalAction, Serializable

public class intention extends DefaultInternalAction

Internal action: .intention( ID, STATE, STACK, [current]) .

Description: returns a description of an intention. It is useful for plans that need to inspect some intention. The description of each item of the intention stack (i.e., an intended means) has the following form:

im(plan label,trigger event,plan body term, unification function (a list of maps))

For example:


[
im(l__6[code_line(10),code_src("karlos.asl"),source(self)], {+!g3}, { .intention(I); .print(end) }, [map(I, ....)]),
im(l__5[code_line(15),code_src("karlos.asl"),source(self)], {+!g5(10)}, { !g3; .fail } , []),
im(l__4[code_line(18),code_src("karlos.asl"),source(self)], {+!start}, { !g5(X); .print(endg4) } , [map(X, test)]),
...
]

Parameters:

  • +/- intention id (number): the unique identifier of the intention.
  • +/- intention state (atom): the state of the intention, suspended, running, ...
  • - intention stack (list, optional): all the intended means of the intention.
  • + current intention (atom, optional): selects only the current intention.

Example:

  • .intention(I,_): I unifies with all intention identifiers.
  • .intention(I,running): I unifies with identifiers of running intentions.
  • .intention(I,_,S): S unifies with intended means stack all intentions.
  • .intention(I,_,_,current): I unifies with the id of the current intention.

Notes:

  • For possible states, see https://github.com/jason-lang/jason/blob/master/doc/tech/intention-states.pdf. Some states can be annotated with further details, for instance: waiting[reason(wait(5)[time(400)])]].
  • In case this internal action is used in the body of a plan, the intention that are executing the plan is used as current.
  • In case this internal action is used in the context of a plan, the intention that produced the event is used current.
See Also: