Package jason.stdlib
Class atom
java.lang.Object
jason.asSemantics.DefaultInternalAction
jason.stdlib.atom
- All Implemented Interfaces:
InternalAction,Serializable
@Manual(literal=".atom(arg)",
hint="checks whether the argument is an atom (a structure with arity 0)",
argsHint="the term to be checked",
argsType="term",
examples={".atom(b(10)): false",".atom(b): true",".atom(~b): false",".atom(10): false",".atom(\"home page\"): false",".atom(X): only true if X is bound to an atom",".atom(a(X)): false",".atom(a[X]): false",".atom([a,b,c]): false",".atom([a,b,c(X)]): false"},
seeAlso={"jason.stdlib.atom","jason.stdlib.list","jason.stdlib.literal","jason.stdlib.number","jason.stdlib.string","jason.stdlib.structure","jason.stdlib.ground"})
public class atom
extends DefaultInternalAction
Internal action: .atom.
Description: checks whether the argument is an atom (a structure with arity 0), for example "p". Numbers, strings, and free variables are not atoms.
Parameters:
- + arg (any term): the term to be checked.
Examples:
-
.atom(b(10)): false. -
.atom(b): true. -
.atom(~b): false. -
.atom(10): false. -
.atom("home page"): false. -
.atom(X): only true if X is bound to an atom. -
.atom(a(X)): false. -
.atom(a[X]): false. -
.atom([a,b,c]): false. -
.atom([a,b,c(X)]): false.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic InternalActioncreate()execute(TransitionSystem ts, Unifier un, Term[] args) Executes the internal action.intintMethods inherited from class jason.asSemantics.DefaultInternalAction
canBeUsedInContext, checkArguments, destroy, prepareArguments, suspendIntention
-
Constructor Details
-
atom
public atom()
-
-
Method Details
-
create
-
getMinArgs
public int getMinArgs()- Overrides:
getMinArgsin classDefaultInternalAction
-
getMaxArgs
public int getMaxArgs()- Overrides:
getMaxArgsin classDefaultInternalAction
-
execute
Description copied from interface:InternalActionExecutes 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:
executein interfaceInternalAction- Overrides:
executein classDefaultInternalAction- Throws:
Exception
-