public class suffix extends DefaultInternalAction
Internal action: .suffix(S,L)
.
Description: checks if some list S is a suffix of list L. If S has free variables, this internal action backtracks all possible values for S.
Parameters:
Examples:
.suffix([c],[a,b,c])
: true..suffix([a,b],[a,b,c])
: false..suffix(X,[a,b,c])
: unifies X with any suffix of the list, i.e., [a,b,c], [b,c], [c], and [] in this order.concat
,
length
,
sort
,
nth
,
max
,
min
,
reverse
,
prefix
,
sublist
,
difference
,
intersection
,
union
,
Serialized FormConstructor and Description |
---|
suffix() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkArguments(Term[] args) |
static InternalAction |
create() |
java.lang.Object |
execute(TransitionSystem ts,
Unifier un,
Term[] args)
Executes the internal action.
|
int |
getMaxArgs() |
int |
getMinArgs() |
canBeUsedInContext, destroy, prepareArguments, suspendIntention
public static InternalAction create()
public int getMinArgs()
getMinArgs
in class DefaultInternalAction
public int getMaxArgs()
getMaxArgs
in class DefaultInternalAction
protected void checkArguments(Term[] args) throws JasonException
checkArguments
in class DefaultInternalAction
JasonException
public java.lang.Object execute(TransitionSystem ts, Unifier un, Term[] args) throws java.lang.Exception
InternalAction
execute
in interface InternalAction
execute
in class DefaultInternalAction
java.lang.Exception