Interface Term<T>
- Type Parameters:
T
- the type of values
- All Superinterfaces:
LogicStructure
- All Known Implementing Classes:
ArithmeticTerm
,Constant
,FunctionalTerm
,Individual
,NumberTerm
,StringTerm
,TermAdapter
,Variable
A term of a logical language, that can be given as argument for logical constructs
like atoms or functors. A term can have a Sort which gives it a types, the default
Sort which is also used by untyped languages is "Thing".
- Author:
- Matthias Thimm, Tim Janus
-
Method Summary
Modifier and TypeMethodDescriptionTerm
<?> clone()
Creates a deep copy of the termget()
getSort()
void
Changes the java-object representation of the term to the given value.Term
<?> substitute
(Term<?> v, Term<?> t) Substitutes all occurrences of term "v" in this term by term "t" and returns the new term.Methods inherited from interface org.tweetyproject.logics.commons.syntax.interfaces.LogicStructure
containsTermsOfType, getTerms, getTerms
-
Method Details
-
set
Changes the java-object representation of the term to the given value.- Parameters:
value
- The new java-object representation of the term.
-
get
T get()- Returns:
- the java-object representation of the term.
-
substitute
Substitutes all occurrences of term "v" in this term by term "t" and returns the new term.- Parameters:
v
- the term to be substituted.t
- the term to substitute.- Returns:
- a term where every occurrence of "v" is replaced by "t".
- Throws:
IllegalArgumentException
- if "v" and "t" are of different sorts (NOTE: this exception is only thrown when "v" actually appears in this formula)
-
getSort
Sort getSort()- Returns:
- the sort (type) of this term.
-
clone
-