Package net.sf.kpex.prolog

Examples of net.sf.kpex.prolog.Const


      String s = IO.promptln(">:");
      if (null == s || s.length() == 0)
      {
        return null;
      }
      return new Const(s);
    }

    if (null == reader)
    {
      return null;
View Full Code Here


      return 0;
    }
    String s = null;
    if (t instanceof Fun && "$string".equals(((Fun) t).getName()))
    {
      Const Xs = (Const) ((Fun) t).getArg(0);
      s = Term.charsToString(Xs);
    }
    else
    {
      s = t.prettyPrint();
View Full Code Here

   *
   * @see Clause
   */
  static public void processClause(Clause C, Map ktable)
  {
    if (C.getHead().matches(new Const("init")))
    {
      Prog.firstSolution(C.getHead(), C.getBody());
    }
    else
    {
View Full Code Here

class IffToken extends Fun
{
  public IffToken(String s)
  {
    super("iffToken", new Const(s));
  }
View Full Code Here

class EocToken extends Fun
{
  public EocToken()
  {
    super("eocToken", new Const("end_of_clause"));
  }
View Full Code Here

    return yes;
  }

  protected final Term makeConst(String s)
  {
    return new ConstToken(builtins.toBuiltin(new Const(s)));
  }
View Full Code Here

      }
    }
    Int I = new Int(occ);
    dict.put(X, I);
    dict.put(s, X);
    return new VarToken(X, new Const(s), I);
  }
View Full Code Here

  public Const newBuiltin(Const S)
  {
    String name = S.getName();
    int arity = S.getArity();
    String key = name + "/" + arity;
    Const b = (Const) get(key);
    return b;
  }
View Full Code Here

   * @see net.sf.kpex.prolog.FunBuiltin#exec(net.sf.kpex.prolog.Prog)
   */
  @Override
  public int exec(Prog p)
  {
    return putArg(0, new Const(p.getDatabase().prettyPrint()), p);
  }
View Full Code Here

  @Override
  public int exec(Prog p)
  {
    Source original = (Source) getArg(0);
    Const Xs = original.toList();
    return putArg(1, new net.sf.kpex.prolog.ListSource(Xs, p), p) > 0
        && putArg(2, new net.sf.kpex.prolog.ListSource(Xs, p), p) > 0 ? 1 : 0;
  }
View Full Code Here

TOP

Related Classes of net.sf.kpex.prolog.Const

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.