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
-
Method Summary
Modifier and TypeMethodDescriptionstatic InternalAction
create()
execute
(TransitionSystem ts, Unifier un, Term[] args) Executes the internal action.int
int
Methods inherited from class jason.asSemantics.DefaultInternalAction
canBeUsedInContext, checkArguments, destroy, prepareArguments, suspendIntention
-
Constructor Details
-
atom
public atom()
-
-
Method Details
-
create
-
getMinArgs
public int getMinArgs()- Overrides:
getMinArgs
in classDefaultInternalAction
-
getMaxArgs
public int getMaxArgs()- Overrides:
getMaxArgs
in classDefaultInternalAction
-
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
-