7374757677787980818283
String s = IO.promptln(">:"); if (null == s || s.length() == 0) { return null; } return new Const(s); } if (null == reader) { return null;
4748495051525354555657
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();
105106107108109110111112113114115
* * @see Clause */ static public void processClause(Clause C, Map ktable) { if (C.getHead().matches(new Const("init"))) { Prog.firstSolution(C.getHead(), C.getBody()); } else {
24252627282930
class IffToken extends Fun { public IffToken(String s) { super("iffToken", new Const(s)); }
class EocToken extends Fun { public EocToken() { super("eocToken", new Const("end_of_clause")); }
106107108109110111112
return yes; } protected final Term makeConst(String s) { return new ConstToken(builtins.toBuiltin(new Const(s))); }
299300301302303304305
} } Int I = new Int(occ); dict.put(X, I); dict.put(s, X); return new VarToken(X, new Const(s), I); }
211212213214215216217218
public Const newBuiltin(Const S) { String name = S.getName(); int arity = S.getArity(); String key = name + "/" + arity; Const b = (Const) get(key); return b; }
38394041424344
* @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); }
373839404142434445
@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; }