public class Variables extends Object
Constructor | Description |
---|---|
Variables() |
Modifier and Type | Method | Description |
---|---|---|
static boolean |
allowUnification(char type,
char uniType) |
|
private static void |
appendToMap(Map<Term,Term> source,
Map<Term,Term> target) |
|
private static Term |
applySubstituteAndRenameVariables(CompoundTerm t,
Map<Term,Term> subs) |
appliesSubstitute and renameVariables, resulting in a cloned object,
will not change this instance
|
static boolean |
containVar(CharSequence n) |
Check whether a string represent a name of a term that contains a
variable
|
static boolean |
containVar(Term[] t) |
|
private static Map<Term,Term>[] |
copyMapFrom(Map<Term,Term>[] source) |
copies two maps from source into two new maps
|
static boolean |
findSubstitute(Random rnd,
char type,
Term term1,
Term term2,
Map<Term,Term>[] map) |
map is a 2-element array of Map<Term,Term>.
|
static boolean |
findSubstitute(Random rnd,
char type,
Term term1,
Term term2,
Map<Term,Term>[] map,
boolean allowPartial) |
|
static boolean |
findSubstitute(Random rnd,
char type,
Term term1,
Term term2,
Map<Term,Term> map1,
Map<Term,Term> map2) |
|
static boolean |
hasSubstitute(Random rnd,
char type,
Term term1,
Term term2) |
Check if two terms can be unified
|
static boolean |
indepVarUsedInvalid(Term T) |
examines whether a term is using an
independent variable in an invalid way
|
static Variable |
makeCommonVariable(Term v1,
Term v2) |
|
static boolean |
unify(Random rnd,
char type,
Term[] t) |
To unify two terms
|
static boolean |
unify(Random rnd,
char type,
Term t1,
Term t2,
Term[] compound) |
To unify two terms
|
static boolean |
unify(Random rnd,
char type,
Term t1,
Term t2,
Term[] compound,
boolean allowPartial) |
public static boolean findSubstitute(Random rnd, char type, Term term1, Term term2, Map<Term,Term> map1, Map<Term,Term> map2)
public static boolean allowUnification(char type, char uniType)
public static boolean findSubstitute(Random rnd, char type, Term term1, Term term2, Map<Term,Term>[] map)
public static boolean findSubstitute(Random rnd, char type, Term term1, Term term2, Map<Term,Term>[] map, boolean allowPartial)
private static Map<Term,Term>[] copyMapFrom(Map<Term,Term>[] source)
source
- source maps (two)public static boolean containVar(CharSequence n)
n
- The string name to be checkedpublic static final boolean containVar(Term[] t)
public static boolean unify(Random rnd, char type, Term[] t)
type
- The type of variable that can be substitutedt
- The first and second term as an array, which will have been modified upon returning truepublic static boolean unify(Random rnd, char type, Term t1, Term t2, Term[] compound)
type
- The type of variable that can be substitutedt1
- The compound containing the first term, possibly modifiedt2
- The compound containing the second term, possibly modifiedcompound
- The first and second term as an array, which will have been modified upon returning truepublic static boolean unify(Random rnd, char type, Term t1, Term t2, Term[] compound, boolean allowPartial)
private static Term applySubstituteAndRenameVariables(CompoundTerm t, Map<Term,Term> subs)
public static boolean indepVarUsedInvalid(Term T)
T
- term to be examinedpublic static boolean hasSubstitute(Random rnd, char type, Term term1, Term term2)
type
- The type of variable that can be substitutedterm1
- The first term to be unifiedterm2
- The second term to be unifiedCopyright © 2020 OpenNARS. All rights reserved.