public class substring extends DefaultInternalAction
Internal action: .substring
.
Description: checks if a string is sub-string of another string. The arguments can be other kinds of terms, in which case the toString() of the term is used. If "position" is a free variable, the internal action backtracks all possible values for the positions where the sub-string occurs in the string.
Parameters:
Examples:
.substring("b","aaa")
: false.
.substring("b","aaa",X)
: false.
.substring("a","bbacc")
: true.
.substring("a","abbacca",X)
: true and X
unifies with 0, 3, and 6.
.substring("a","bbacc",0)
: false.
.substring(a(10),b(t1,a(10)),X)
: true and X
unifies with 5.
.substring(a(10),b("t1,a(10),kk"),X)
: true and X
unifies with 6.
.substring(a(10,20),R,5)
: true and R
unifies with "20)".
.substring(a(10,20),R,5,7)
: true and R
unifies with "20".
concat
,
delete
,
length
,
reverse
,
Serialized FormModifier and Type | Field and Description |
---|---|
private static InternalAction |
singleton |
Constructor and Description |
---|
substring() |
Modifier and Type | Method and Description |
---|---|
static InternalAction |
create() |
java.lang.Object |
execute(TransitionSystem ts,
Unifier un,
Term[] args)
Executes the internal action.
|
int |
getMaxArgs() |
int |
getMinArgs() |
canBeUsedInContext, checkArguments, destroy, prepareArguments, suspendIntention
private static InternalAction singleton
public static InternalAction create()
public int getMinArgs()
getMinArgs
in class DefaultInternalAction
public int getMaxArgs()
getMaxArgs
in class DefaultInternalAction
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