Package net.sf.kpex.prolog

Examples of net.sf.kpex.prolog.Fun


    Clause SuperC = new Clause(Vs, C);
    SuperC.dict = C.dict;
    Clause NamedSuperC = SuperC.cnumbervars(false);
    Term Ns = NamedSuperC.getHead();
    Term NamedC = NamedSuperC.getBody();
    return new Fun("clause", C, Vs, NamedC, Ns);
  }
View Full Code Here


    {
      found = Const.NO;
    }
    else
    {
      found = new Fun("the", found.copy());
    }
    return found;
  }
View Full Code Here

    Vector To = new Vector();
    for (String key : keySet())
    {
      all0(max, To, key, FXs);
    }
    Fun R = new Fun("$", To.size());
    // IO.mes("RR"+R);
    To.copyInto(R.args);
    return ((Cons) R.listify()).args[1];
  }
View Full Code Here

    all0(max, To, k, FXs);
    if (To.size() == 0)
    {
      return Const.NIL;
    }
    Fun R = new Fun("$", To.size());
    To.copyInto(R.args);
    Term T = ((Cons) R.listify()).args[1];
    return T;
  }
View Full Code Here

        IO.println("no");
        break;
      }
      if (Names instanceof Fun)
      {
        Fun NamedR = (Fun) R.numberVars();
        for (int j = 0; j < Names.getArity(); j++)
        {
          IO.println(((Fun) Names).getArg(j) + "=" + NamedR.getArg(j));
        }
        // IO.println(";");
        if (!moreAnswers(i))
        {
          E.stop();
View Full Code Here

class FunToken extends Fun
{
  public FunToken(String s)
  {
    super("funToken", new Fun(s));
  }
View Full Code Here

   */
  @Override
  public int exec(Prog p)
  {
    int i = getIntArg(0);
    Fun F = (Fun) getArg(1);
    Term A = i == 0 ? new Const(F.getName()) : i == -1 ? new Int(F.getArity()) : F.args[i - 1];
    return putArg(2, A, p);
  }
View Full Code Here

    String mes = e.getMessage();
    if (null == mes)
    {
      mes = "unknown_error";
    }
    Fun f = new Fun("error", new Const(type), new Const(mes), new Fun("line", new Int(line)));
    Clause C = new Clause(f, Const.TRUE);
    if (verbose)
    {
      IO.errmes(type + " error at line:" + line);
      IO.errmes(C.prettyPrint(), e);
View Full Code Here

    {
      t = getList();
    }
    else if (n instanceof FunToken)
    {
      Fun f = (Fun) t;
      f.args = getArgs();
      t = builtins.toBuiltin(f);
    }
    else
    {
View Full Code Here

      g.setColor(color);
    }
    Enumeration E = V.elements();
    while (E.hasMoreElements())
    {
      Fun T = (Fun) E.nextElement();
      IO.mes("drawing: " + T);
      int x = T.getIntArg(0);
      int y = T.getIntArg(1);
      int dx = T.getIntArg(2);
      int dy = T.getIntArg(3);
      g.fill3DRect(x, y, dx, dy, true);
    }
  }
View Full Code Here

TOP

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

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.