public class PrologUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
RENAMED_VAR_PREFIX |
Constructor and Description |
---|
PrologUtil() |
Modifier and Type | Method and Description |
---|---|
static List<Var> |
anonymousVariables(int n)
Answers a list of anonymous logic variables
|
static Term |
applyFunctor(String functor,
String atom)
Surround an atom with a functor
|
static String |
escapeString(String s) |
static List<Term> |
forEachApplyFunctor(String functor,
List<? extends Term> terms) |
static List<Term> |
getChildren(Term term) |
static boolean |
isEquals(Term term)
Returns whether the term is a compound with functor("=", 2)
|
static boolean |
isPair(Term term) |
static Term |
replaceVariables(Term term) |
static Term |
replaceVariables(Term term,
String prefix)
Renames the vars of a term adding a prefix
Useful to avoid unexpected results when unifying two terms that do not share the same variable namespace
|
static Term |
varDictionaryTerm(Term term) |
public static final String RENAMED_VAR_PREFIX
public static boolean isEquals(Term term)
term
- public static boolean isPair(Term term)
public static Term applyFunctor(String functor, String atom)
atom
- functor
- public static List<Term> forEachApplyFunctor(String functor, List<? extends Term> terms)
public static List<Var> anonymousVariables(int n)
n
- the number of variables in the arraypublic static Term replaceVariables(Term term, String prefix)
term
- Copyright © 2014. All rights reserved.