Package jason.stdlib
Class setof
java.lang.Object
jason.asSemantics.DefaultInternalAction
jason.stdlib.setof
- All Implemented Interfaces:
InternalAction
,Serializable
@Manual(literal=".setof(term,query,result)",
hint="builds a Set of all instantiations of referred term which make query a logical consequence of the agent\'s BB",
argsHint={"the variable or structure whose instances will \"populate\" the set","the formula used to find literals in the belief base","the result set populated with found solutions for the query"},
argsType={"variable or structure","logical formula","list"},
examples=".setof(X,c(X),L): assuming current BB with {c(100),c(200),c(100)}, L unifies with [100,200]",
seeAlso={"jason.stdlib.count","jason.stdlib.findall"})
public class setof
extends DefaultInternalAction
Internal action: .setof(Term,Query,List)
.
Description: builds a Set of unique instantiations of Term which make Query a logical consequence of the agent's BB.
Parameters:
- + term (variable or structure): the variable or structure whose
instances will "populate" the set.
- + query (logical formula): the formula used to find literals in the belief base;
is has the same syntax as the plan context.
- +/- result (list): the result set populated with found solutions for the query.
Examples assuming the BB is currently {c(100),c(200),c(100)}:
-
.setof(X,c(X),L)
:L
unifies with[100,200]
.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkArguments
(Term[] args) execute
(TransitionSystem ts, Unifier un, Term[] args) Executes the internal action.int
int
Term[]
prepareArguments
(Literal body, Unifier un) Prepare body's terms to be used in 'execute', normally it consist of cloning and applying each termMethods inherited from class jason.asSemantics.DefaultInternalAction
canBeUsedInContext, destroy, suspendIntention
-
Constructor Details
-
setof
public setof()
-
-
Method Details
-
getMinArgs
public int getMinArgs()- Overrides:
getMinArgs
in classDefaultInternalAction
-
getMaxArgs
public int getMaxArgs()- Overrides:
getMaxArgs
in classDefaultInternalAction
-
prepareArguments
Description copied from interface:InternalAction
Prepare body's terms to be used in 'execute', normally it consist of cloning and applying each term- Specified by:
prepareArguments
in interfaceInternalAction
- Overrides:
prepareArguments
in classDefaultInternalAction
-
checkArguments
- Overrides:
checkArguments
in classDefaultInternalAction
- Throws:
JasonException
-
execute
Description copied from interface:InternalAction
Executes the internal action. It should return a Boolean or an Iterator. A true boolean return means that the IA was successfully executed. An Iterator result means that there is more than one answer for this IA (e.g. see member internal action). - Specified by:
execute
in interfaceInternalAction
- Overrides:
execute
in classDefaultInternalAction
- Throws:
Exception
-