public class Sort extends Object implements LogicStructure
| Modifier and Type | Field and Description |
|---|---|
static Sort |
THING
Default sort for unsorted first-order logics
|
| Constructor and Description |
|---|
Sort(Sort other)
Copy-Ctor creates a deep copy of the Sort
|
Sort(String name)
Ctor: Creates an empty Sort with the given name.
|
Sort(String name,
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(Class<C> cls)
Checks if this logical structure contains at least one term of type C.
|
boolean |
equals(Object obj) |
String |
getName() |
Set<Term<?>> |
getTerms() |
<C extends Term<?>> |
getTerms(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 Map<Sort,Set<Term<?>>> |
sortTerms(Collection<? extends Term<?>> terms)
Sorts the set of given terms by their sorts, i.e.
|
String |
toString() |
public static final Sort THING
public Sort(String name)
name - The name of the Sortpublic Sort(String name, 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 Map<Sort,Set<Term<?>>> sortTerms(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 String getName()
public Set<Term<?>> getTerms()
getTerms in interface LogicStructurepublic <C extends Term<?>> Set<C> getTerms(Class<C> cls)
LogicStructuregetTerms in interface LogicStructurecls - The Class structure containing type information about the
searched termpublic <C extends Term<?>> boolean containsTermsOfType(Class<C> cls)
LogicStructurecontainsTermsOfType in interface LogicStructurecls - The class structure representing the type C of the term.Copyright © 2018. All rights reserved.