Class Term
java.lang.Object
de.uni_freiburg.informatik.ultimate.logic.Term
- Direct Known Subclasses:
AnnotatedTerm,ApplicationTerm,ConstantTerm,LambdaTerm,LetTerm,MatchTerm,QuantifiedFormula,TermVariable
public abstract class Term
extends java.lang.Object
This is the base class for representing SMTLIB 2 terms. You can assume that
every term is one of the following sub-classes:
ApplicationTermrepresents a function application(name ...).AnnotatedTermrepresents an annotated term(! term ...).ConstantTermrepresents a numeral, decimal, bit vector, or string literal.LambdaTermrepresents a lambda term(lambda ((var sort)...) term).LetTermrepresents a let term(let ((var term)...) term).MatchTermrepresents a datatype match term(match d (cases...)).TermVariablerepresents a term variablevarused in quantifier or let term. Note that constants are represented by ApplicationTerm.QuantifiedFormularepresents a quantified formula(exists/forall ...).
- Author:
- Juergen Christ, Jochen Hoenicke
-
Field Summary
Fields Modifier and Type Field Description intmTmpCtrA temporary counter used e.g. -
Constructor Summary
Constructors Modifier Constructor Description protectedTerm(int hash)Create a term. -
Method Summary
Modifier and Type Method Description TermVariable[]getFreeVars()Computes and returns the free variables occurring in this term.abstract SortgetSort()Returns the SMTLIB sort of this term.de.uni_freiburg.informatik.ultimate.logic.TheorygetTheory()inthashCode()java.lang.StringtoString()Prints an SMTLIB representation of this term.java.lang.StringtoStringDirect()Prints the canonical SMTLIB representation of this term.protected abstract voidtoStringHelper(java.util.ArrayDeque<java.lang.Object> mTodo)Convert a term to a string in a stack based fashion.
-
Field Details
-
mTmpCtr
public int mTmpCtrA temporary counter used e.g. to count the number of occurrences of this term in a bigger term. Don't use this!!!!
-
-
Constructor Details
-
Term
protected Term(int hash)Create a term.- Parameters:
hash- the hash code of the term. This should be stable.
-
-
Method Details
-
getSort
Returns the SMTLIB sort of this term.- Returns:
- the sort of the term.
-
getFreeVars
Computes and returns the free variables occurring in this term.- Returns:
- the free variables.
-
getTheory
public de.uni_freiburg.informatik.ultimate.logic.Theory getTheory() -
toString
public java.lang.String toString()Prints an SMTLIB representation of this term. Thisintroduces lets for common subexpressionsto prevent exponential blow-up when printing a term with lots of sharing.- Overrides:
toStringin classjava.lang.Object- Returns:
- an SMTLIB representation.
-
toStringDirect
public java.lang.String toStringDirect()Prints the canonical SMTLIB representation of this term. This does not eliminate common sub-expressions and can cause exponential blow-up.- Returns:
- the canonical SMTLIB representation.
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
toStringHelper
protected abstract void toStringHelper(java.util.ArrayDeque<java.lang.Object> mTodo)Convert a term to a string in a stack based fashion. This is used for internal purposes. External users can just use toString() or toStringDirect().- Parameters:
mTodo- The stack where to put the strings and sub terms.- See Also:
PrintTerm
-