Пример #1
0
 public boolean atom_length_2(Term arg0, Term len) throws PrologError {
   arg0 = arg0.getTerm();
   if (arg0 instanceof Var) throw PrologError.instantiation_error(engine.getEngineManager(), 1);
   if (!arg0.isAtom()) throw PrologError.type_error(engine.getEngineManager(), 1, "atom", arg0);
   Struct atom = (Struct) arg0;
   return unify(len, new Int(atom.getName().length()));
 }
Пример #2
0
 @SuppressWarnings("unchecked")
 public Clause(Struct s) {
   this(
       s.getName().equals(":-") ? (H) Term.unmarshal(s.getArg(0)) : (H) Term.unmarshal(s),
       s.getName().equals(":-") ? (B) Term.unmarshal(s.getArg(1)) : null);
 }