Class ConstantTerm
java.lang.Object
de.uni_freiburg.informatik.ultimate.logic.Term
de.uni_freiburg.informatik.ultimate.logic.ConstantTerm
public class ConstantTerm extends Term
A term representing constants. The Java-type of the constant depends on the
SMTLIB-type and the origin of the term. If this term has numeral sort and
stems from model evaluation, the Java-type of the constant will be
Rational. If it comes from user input it typically is BigInteger for
numerals or BigDecimal for decimals (note that you can also use Rational with
the API, but the parser won't do that).
A constant term is created by the
Script.numeral(java.math.BigInteger),
Script.decimal(BigDecimal),
Script.binary(String),
Script.hexadecimal(String), and
Script.string(QuotedObject).
Also Rational.toTerm(Sort) creates a constant term.- Author:
- hoenicke, Juergen Christ
-
Field Summary
-
Method Summary
Modifier and Type Method Description SortgetSort()Returns the SMTLIB sort of this term.java.lang.ObjectgetValue()Gets the constant value.static inthashConstant(java.lang.Object value, Sort sort)java.lang.StringtoString()Prints an SMTLIB representation of this term.java.lang.StringtoStringDirect()Prints the canonical SMTLIB representation of this term.voidtoStringHelper(java.util.ArrayDeque<java.lang.Object> mTodo)Convert a term to a string in a stack based fashion.Methods inherited from class de.uni_freiburg.informatik.ultimate.logic.Term
getFreeVars, getTheory, hashCode
-
Method Details
-
getValue
public java.lang.Object getValue()Gets the constant value. If this term has numeral sort and stems from model evaluation, the Java-type of the constant will beRational. If it comes from user input it typically is BigInteger for numerals or BigDecimal for decimals (note that you can also use Rational with the API, but the parser won't do that). For string literals this is aQuotedObjectcontaining a string. Bit vector constants are represented by BigInteger.- Returns:
- the value.
-
getSort
Description copied from class:TermReturns the SMTLIB sort of this term. -
toString
public java.lang.String toString()Description copied from class:TermPrints an SMTLIB representation of this term. Thisintroduces lets for common subexpressionsto prevent exponential blow-up when printing a term with lots of sharing. -
toStringDirect
public java.lang.String toStringDirect()Description copied from class:TermPrints the canonical SMTLIB representation of this term. This does not eliminate common sub-expressions and can cause exponential blow-up.- Overrides:
toStringDirectin classTerm- Returns:
- the canonical SMTLIB representation.
-
hashConstant
-
toStringHelper
public void toStringHelper(java.util.ArrayDeque<java.lang.Object> mTodo)Description copied from class:TermConvert a term to a string in a stack based fashion. This is used for internal purposes. External users can just use toString() or toStringDirect().- Specified by:
toStringHelperin classTerm- Parameters:
mTodo- The stack where to put the strings and sub terms.- See Also:
PrintTerm
-