Exemple #1
0
 /** @throws ParseException */
 public static boolean isFreeLiteral(Env env, String plit) throws ParseException {
   Literal pl = IndepPLiteral.toLiteral(plit, env, false);
   int arity = env.getSymTable().getArity(pl.getName(), TermTypes.PREDICATE);
   List<String> seenVar = new ArrayList<String>();
   for (int i = 0; i < arity; i++) {
     String v = pl.getArg(i).toString();
     if (!v.startsWith("_") || seenVar.contains(v)) return false;
     seenVar.add(v);
   }
   return true;
 }
Exemple #2
0
 public int getArity(Term t, Env env) {
   return env.getSymTable().getArity(t.getStartName(), t.getStartType());
 }
Exemple #3
0
 public String getSymbol(Term t, Env env) {
   return env.getSymTable().get(t.getStartName(), t.getStartType());
 }
Exemple #4
0
 /**
  * Gets the predicate of the literal.
  *
  * @param env The environment.
  * @param literal The literal.
  */
 public static String getPredicate(Env env, Literal literal) {
   return env.getSymTable().get(literal.getName(), literal.getTerm().getStartType());
 }