Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package jason.stdlib;

Internal action: .string.

Description: checks whether the argument is a string, e.g.: "a".


  • + arg[0] (any term): the term to be checked.


  • .string("home page"): true.
  • .string(b(10)): false.
  • .string(b): false.
  • .string(X): false if X is free, true if X is bound to a string.

public class string extends DefaultInternalAction {
    private static InternalAction singleton = null;
    public static InternalAction create() {
        if ( == null
             = new string();
        return ;
    @Override public int getMinArgs() { return 1; }
    @Override public int getMaxArgs() { return 1; }
    public Object execute(TransitionSystem tsUnifier unTerm[] argsthrows Exception {
        return args[0].isString();
New to GrepCode? Check out our FAQ X