Package net.sf.kpex.prolog

Examples of net.sf.kpex.prolog.Int


      stop();
      return null;
    }
    else
    {
      return new Int(c);
    }
  }
View Full Code Here


      {
        occ = ((Int) dict.get(X)).longValue();
        occ++;
      }
    }
    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

  @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

   * @see net.sf.kpex.prolog.FunBuiltin#exec(net.sf.kpex.prolog.Prog)
   */
  @Override
  public int exec(Prog p)
  {
    Int N = new Int(getArg(0).getArity());
    return putArg(1, N, p);
  }
View Full Code Here

class IntToken extends Fun
{
  public IntToken(int i)
  {
    super("intToken", new Int(i));
  }
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

      try
      {
        double r = Double.valueOf(s).doubleValue();
        if (Math.floor(r) == r)
        {
          T = new Int((long) r);
        }
        else
        {
          T = new Real(r);
        }
View Full Code Here

   * @see net.sf.kpex.prolog.FunBuiltin#exec(net.sf.kpex.prolog.Prog)
   */
  @Override
  public int exec(Prog p)
  {
    Term T = new Int(java.lang.System.currentTimeMillis() - t0);
    return putArg(0, T, p);
  }
View Full Code Here

      default:
        IO.errmes("bad arithmetic operation <" + op + "> on " + x + " and " + y);
        return 0;
    }
    Num R = Math.floor(r) == r ? (Num) new Int((long) r) : (Num) new Real(r);
    return putArg(3, R, p);
  }
View Full Code Here

TOP

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

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.