public class Sort extends java.lang.Object implements LogicStructure
| Modifier and Type | Field and Description |
|---|---|
private java.util.Set<Constant> |
constants
The set of constants of this sort
|
private java.lang.String |
name
The name of the sort
|
static Sort |
THING
Default sort for unsorted first-order logics
|
private java.util.Set<Variable> |
variables
The set of variables of this sort
|
| Constructor and Description |
|---|
Sort(Sort other)
Copy-Ctor creates a deep copy of the Sort
|
Sort(java.lang.String name)
Ctor: Creates an empty Sort with the given name.
|
Sort(java.lang.String name,
java.util.Set<Constant> constants)
Ctor: Creates a Sort with the given name and the given constants.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Term<?> term)
Adds the given term to this sort.
|
Sort |
clone() |
<C extends Term<?>> |
containsTermsOfType(java.lang.Class<C> cls)
Checks if this logical structure contains at least one term of type C.
|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getName() |
java.util.Set<Term<?>> |
getTerms() |
<C extends Term<?>> |
getTerms(java.lang.Class<C> cls)
Processes the set containing all terms of type C.
|
int |
hashCode() |
boolean |
remove(Term<?> term)
Removes the given term from this sort.
|
static java.util.Map<Sort,java.util.Set<Term<?>>> |
sortTerms(java.util.Collection<? extends Term<?>> terms)
Sorts the set of given terms by their sorts, i.e.
|
java.lang.String |
toString() |
private java.lang.String name
private java.util.Set<Constant> constants
private java.util.Set<Variable> variables
public static final Sort THING
public Sort(java.lang.String name)
name - The name of the Sortpublic Sort(java.lang.String name,
java.util.Set<Constant> constants)
name - The name of the Sortconstants - A set of constants which are members of the sort.public Sort(Sort other)
other - The Sort that acts as copy sourcepublic static java.util.Map<Sort,java.util.Set<Term<?>>> sortTerms(java.util.Collection<? extends Term<?>> terms)
terms - a set of terms.public void add(Term<?> term)
term - public boolean remove(Term<?> term)
term - a term, either a variable or a constant.public java.lang.String getName()
public java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.util.Set<Term<?>> getTerms()
getTerms in interface LogicStructurepublic <C extends Term<?>> java.util.Set<C> getTerms(java.lang.Class<C> cls)
LogicStructuregetTerms in interface LogicStructurecls - The Class structure containing type information about the
searched termpublic <C extends Term<?>> boolean containsTermsOfType(java.lang.Class<C> cls)
LogicStructurecontainsTermsOfType in interface LogicStructurecls - The class structure representing the type C of the term.public Sort clone()
clone in class java.lang.Object