Package jason.stdlib
Class type
java.lang.Object
jason.asSemantics.DefaultInternalAction
jason.stdlib.type
- All Implemented Interfaces:
InternalAction
,Serializable
@Manual(literal=".type(argument,type)",
hint="retrieves types of the argument or checks whether the argument is of a given type",
argsHint={"the term to be checked","the given type or a variable to retrieves types"},
argsType={"term","term or variable"},
examples={".type(\"home page\",string): true",".type(b(10),string): false",".type(b,T): unifies T with the term \'atom\' and backtracks unifying T with \'literal\' and \'ground\'",".type(X,T): unifies T with the term \'free\' if X is free, or other types if X is not free"},
seeAlso={"jason.stdlib.atom","jason.stdlib.list","jason.stdlib.literal","jason.stdlib.number","jason.stdlib.string","jason.stdlib.structure","jason.stdlib.ground"})
public class type
extends DefaultInternalAction
Internal action: .type
.
Description: retrieves types of the argument.
Parameter:
- + argument (any term): the term to be checked.
- +/- type (atom or variable): the given type or a variable. Values are atoms.
Examples:
-
.type(\"home page\",string)
: true. -
.type(b(10),string)
: false. -
.type(b,T)
: unifies T with the term 'atom' and backtracks unifying T with 'literal' and 'ground'. -
.type(X,T)
: unifies T with the term 'free' if X is free, or other types if X is not free.
- 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
-
type
public type()
-
-
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
-