public class ConstantTerm extends Term
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(String)
.
Also Rational.toTerm(Sort)
creates a constant term.Modifier and Type | Method and Description |
---|---|
Sort |
getSort()
Returns the SMTLIB sort of this term.
|
java.lang.Object |
getValue()
Gets the constant value.
|
static int |
hashConstant(java.lang.Object value,
Sort sort) |
java.lang.String |
toString()
Prints an SMTLIB representation of this term.
|
java.lang.String |
toStringDirect()
Prints the canonical SMTLIB representation of this term.
|
void |
toStringHelper(java.util.ArrayDeque<java.lang.Object> mTodo)
Convert a term to a string in a stack based fashion.
|
getFreeVars, getTheory, hashCode
public java.lang.Object getValue()
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). For string literals this
is a QuotedObject
containing a string. Bit vector constants
are represented by BigInteger.public Sort getSort()
Term
public java.lang.String toString()
Term
introduces lets for common subexpressions
to prevent exponential blow-up when printing
a term with lots of sharing.public java.lang.String toStringDirect()
Term
toStringDirect
in class Term
public static final int hashConstant(java.lang.Object value, Sort sort)
public void toStringHelper(java.util.ArrayDeque<java.lang.Object> mTodo)
Term
toStringHelper
in class Term
mTodo
- The stack where to put the strings and sub terms.PrintTerm