public class TermManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected long |
pointer |
Constructor and Description |
---|
TermManager()
Create a term manager instance.
|
Modifier and Type | Method and Description |
---|---|
void |
deletePointer() |
protected void |
deletePointer(long pointer) |
boolean |
equals(java.lang.Object o) |
Sort |
getBooleanSort()
Get the Boolean sort.
|
Sort |
getIntegerSort()
Get the integer sort.
|
long |
getIntegerSort(long pointer) |
int |
getNumIndicesForSkolemId(SkolemId id)
Get the number of indices for a given skolem id.
|
long |
getPointer() |
Sort |
getRealSort()
Get the real sort.
|
Sort |
getRegExpSort()
Get the regular expression sort.
|
Sort |
getRoundingModeSort()
Get the floating-point rounding mode sort.
|
Statistics |
getStatistics()
Get a snapshot of the current state of the statistic values of this
term manager.
|
Sort |
getStringSort()
Get the string sort.
|
Sort |
mkAbstractSort(SortKind kind)
Create an abstract sort.
|
Sort |
mkArraySort(Sort indexSort,
Sort elemSort)
Create an array sort.
|
Sort |
mkBagSort(Sort elemSort)
Create a bag sort.
|
Term |
mkBitVector(int size)
Create a bit-vector constant of given size and value = 0.
|
Term |
mkBitVector(int size,
long val)
Create a bit-vector constant of given size and value.
|
Term |
mkBitVector(int size,
java.lang.String s,
int base)
Create a bit-vector constant of a given bit-width from a given string of
base 2, 10 or 16.
|
Sort |
mkBitVectorSort(int size)
Create a bit-vector sort.
|
Term |
mkBoolean(boolean val)
Create a Boolean constant.
|
Term |
mkCardinalityConstraint(Sort sort,
int upperBound)
Create a cardinality constraint for an uninterpreted sort.
|
Term |
mkConst(Sort sort)
Create a free constant with a default symbol name.
|
Term |
mkConst(Sort sort,
java.lang.String symbol)
Create a free constant.
|
Term |
mkConstArray(Sort sort,
Term val)
Create a constant array with the provided constant value stored at
every index
|
DatatypeConstructorDecl |
mkDatatypeConstructorDecl(java.lang.String name)
Create a datatype constructor declaration.
|
DatatypeDecl |
mkDatatypeDecl(java.lang.String name)
Create a datatype declaration.
|
DatatypeDecl |
mkDatatypeDecl(java.lang.String name,
boolean isCoDatatype)
Create a datatype declaration.
|
DatatypeDecl |
mkDatatypeDecl(java.lang.String name,
Sort[] params)
Create a datatype declaration.
|
DatatypeDecl |
mkDatatypeDecl(java.lang.String name,
Sort[] params,
boolean isCoDatatype)
Create a datatype declaration.
|
Sort |
mkDatatypeSort(DatatypeDecl dtypedecl)
Create a datatype sort.
|
Sort[] |
mkDatatypeSorts(DatatypeDecl[] dtypedecls)
Create a vector of datatype sorts.
|
Term |
mkEmptyBag(Sort sort)
Create a constant representing an empty bag of the given sort.
|
Term |
mkEmptySequence(Sort sort)
Create an empty sequence of the given element sort.
|
Term |
mkEmptySet(Sort sort)
Create a constant representing an empty set of the given sort.
|
Term |
mkFalse()
Create a Boolean
false constant. |
Term |
mkFiniteFieldElem(java.lang.String val,
Sort sort,
int base)
Create a finite field constant in a given field and for a given value.
|
Sort |
mkFiniteFieldSort(java.lang.String size,
int base)
Create a finite field sort.
|
Term |
mkFloatingPoint(int exp,
int sig,
Term val)
Create a floating-point value from a bit-vector given in IEEE-754
format.
|
Term |
mkFloatingPoint(Term sign,
Term exp,
Term sig)
Create a floating-point value from its three IEEE-754 bit-vector value
components (sign bit, exponent, significand).
|
Term |
mkFloatingPointNaN(int exp,
int sig)
Create a not-a-number floating-point constant (SMT-LIB:
NaN ). |
Term |
mkFloatingPointNegInf(int exp,
int sig)
Create a negative infinity floating-point constant (SMT-LIB:
-oo ). |
Term |
mkFloatingPointNegZero(int exp,
int sig)
Create a negative zero floating-point constant (SMT-LIB:
-zero ). |
Term |
mkFloatingPointPosInf(int exp,
int sig)
Create a positive infinity floating-point constant (SMT-LIB:
+oo ). |
Term |
mkFloatingPointPosZero(int exp,
int sig)
Create a positive zero floating-point constant (SMT-LIB:
+zero ). |
Sort |
mkFloatingPointSort(int exp,
int sig)
Create a floating-point sort.
|
Sort |
mkFunctionSort(Sort[] sorts,
Sort codomain)
Create function sort.
|
Sort |
mkFunctionSort(Sort domain,
Sort codomain)
Create function sort.
|
Term |
mkInteger(long val)
Create an integer constant from a C++
int . |
Term |
mkInteger(java.lang.String s)
Create an integer constant from a string.
|
Term |
mkNullableIsNull(Term term)
Create a null tester for a nullable term.
|
Term |
mkNullableIsSome(Term term)
Create a some tester for a nullable term.
|
Term |
mkNullableLift(Kind kind,
Term[] args)
Create a term that lifts kind to nullable terms.
|
Term |
mkNullableNull(Sort sort)
Create a constant representing a null value of the given sort.
|
Term |
mkNullableSome(Term term)
Create a nullable some term.
|
Sort |
mkNullableSort(Sort sort)
Create a nullable sort.
|
Term |
mkNullableVal(Term term)
Create a selector for nullable term.
|
Op |
mkOp(Kind kind)
Create an operator for a builtin Kind
The Kind may not be the Kind for an indexed operator
(e.g.,
Kind.BITVECTOR_EXTRACT ). |
Op |
mkOp(Kind kind,
int arg)
Create operator of kind:
DIVISIBLE
BITVECTOR_REPEAT
BITVECTOR_ZERO_EXTEND
BITVECTOR_SIGN_EXTEND
BITVECTOR_ROTATE_LEFT
BITVECTOR_ROTATE_RIGHT
INT_TO_BITVECTOR
FLOATINGPOINT_TO_UBV
FLOATINGPOINT_TO_UBV_TOTAL
FLOATINGPOINT_TO_SBV
FLOATINGPOINT_TO_SBV_TOTAL
TUPLE_UPDATE
See enum
Kind for a description of the parameters. |
Op |
mkOp(Kind kind,
int[] args)
Create operator of Kind:
TUPLE_PROJECT
See enum
Kind for a description of the parameters. |
Op |
mkOp(Kind kind,
int arg1,
int arg2)
Create operator of Kind:
BITVECTOR_EXTRACT
FLOATINGPOINT_TO_FP_FROM_IEEE_BV
FLOATINGPOINT_TO_FP_FROM_FP
FLOATINGPOINT_TO_FP_FROM_REAL
FLOATINGPOINT_TO_FP_FROM_SBV
FLOATINGPOINT_TO_FP_FROM_UBV
See enum
Kind for a description of the parameters. |
Op |
mkOp(Kind kind,
java.lang.String arg)
Create operator of kind:
Kind.DIVISIBLE (to support arbitrary precision integers)
See enum Kind for a description of the parameters. |
Sort |
mkParamSort()
Create a sort parameter.
|
Sort |
mkParamSort(java.lang.String symbol)
Create a sort parameter.
|
Term |
mkPi()
Create a constant representing the number Pi.
|
Sort |
mkPredicateSort(Sort[] sorts)
Create a predicate sort.
|
Term |
mkReal(long val)
Create a real constant from an integer.
|
Term |
mkReal(long num,
long den)
Create a real constant from a rational.
|
Term |
mkReal(java.lang.String s)
Create a real constant from a string.
|
Sort |
mkRecordSort(Pair<java.lang.String,Sort>[] fields)
Create a record sort
|
Term |
mkRegexpAll()
Create a regular expression all (
re.all ) term. |
Term |
mkRegexpAllchar()
Create a regular expression allchar (
re.allchar ) term. |
Term |
mkRegexpNone()
Create a regular expression none (
re.none ) term. |
Term |
mkRoundingMode(RoundingMode rm)
Create a rounding mode constant.
|
Term |
mkSepEmp()
Create a separation logic empty term.
|
Term |
mkSepNil(Sort sort)
Create a separation logic nil term.
|
Sort |
mkSequenceSort(Sort elemSort)
Create a sequence sort.
|
Sort |
mkSetSort(Sort elemSort)
Create a set sort.
|
Term |
mkSkolem(SkolemId skolemId,
Term[] indices)
Create a skolem
|
Term |
mkString(int[] s)
Create a String constant.
|
Term |
mkString(java.lang.String s)
Create a String constant.
|
Term |
mkString(java.lang.String s,
boolean useEscSequences)
Create a String constant.
|
Term |
mkTerm(Kind kind)
Create 0-ary term of given kind.
|
Term |
mkTerm(Kind kind,
Term child)
Create a unary term of given kind.
|
Term |
mkTerm(Kind kind,
Term[] children)
Create n-ary term of given kind.
|
Term |
mkTerm(Kind kind,
Term child1,
Term child2)
Create binary term of given kind.
|
Term |
mkTerm(Kind kind,
Term child1,
Term child2,
Term child3)
Create ternary term of given kind.
|
Term |
mkTerm(Op op)
Create nullary term of given kind from a given operator.
|
Term |
mkTerm(Op op,
Term child)
Create unary term of given kind from a given operator.
|
Term |
mkTerm(Op op,
Term[] children)
Create n-ary term of given kind from a given operator.
|
Term |
mkTerm(Op op,
Term child1,
Term child2)
Create binary term of given kind from a given operator.
|
Term |
mkTerm(Op op,
Term child1,
Term child2,
Term child3)
Create ternary term of given kind from a given operator.
|
Term |
mkTrue()
Create a Boolean
true constant. |
Term |
mkTuple(Term[] terms)
Create a tuple term.
|
Sort |
mkTupleSort(Sort[] sorts)
Create a tuple sort.
|
Sort |
mkUninterpretedSort()
Create an uninterpreted sort.
|
Sort |
mkUninterpretedSort(java.lang.String symbol)
Create an uninterpreted sort.
|
Sort |
mkUninterpretedSortConstructorSort(int arity)
Create a sort constructor sort.
|
Sort |
mkUninterpretedSortConstructorSort(int arity,
java.lang.String symbol)
Create a sort constructor sort.
|
Term |
mkUniverseSet(Sort sort)
Create a universe set of the given sort.
|
Sort |
mkUnresolvedDatatypeSort(java.lang.String symbol)
Create an unresolved datatype sort.
|
Sort |
mkUnresolvedDatatypeSort(java.lang.String symbol,
int arity)
Create an unresolved datatype sort.
|
Term |
mkVar(Sort sort)
Create a bound variable to be used in a binder (i.e., a quantifier, a
lambda, or a witness binder).
|
Term |
mkVar(Sort sort,
java.lang.String symbol)
Create a bound variable to be used in a binder (i.e., a quantifier, a
lambda, or a witness binder).
|
java.lang.String |
toString() |
protected java.lang.String |
toString(long pointer) |
protected void deletePointer(long pointer)
protected java.lang.String toString(long pointer)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public Statistics getStatistics()
public Sort getBooleanSort()
public Sort getIntegerSort()
public long getIntegerSort(long pointer)
public Sort getRealSort()
public Sort getRegExpSort()
public Sort getRoundingModeSort() throws CVC5ApiException
CVC5ApiException
- on errorpublic Sort getStringSort()
public Sort mkArraySort(Sort indexSort, Sort elemSort)
indexSort
- The array index sort.elemSort
- The array element sort.public Sort mkBitVectorSort(int size) throws CVC5ApiException
size
- The bit-width of the bit-vector sort.CVC5ApiException
- on errorpublic Sort mkFiniteFieldSort(java.lang.String size, int base) throws CVC5ApiException
size
- The size of the finite field sort.base
- The base of the string representation.CVC5ApiException
- on errorpublic Sort mkFloatingPointSort(int exp, int sig) throws CVC5ApiException
exp
- The bit-width of the exponent of the floating-point sort.sig
- The bit-width of the significand of the floating-point sort.CVC5ApiException
- on errorpublic Sort mkDatatypeSort(DatatypeDecl dtypedecl) throws CVC5ApiException
dtypedecl
- The datatype declaration from which the sort is created.CVC5ApiException
- on errorpublic Sort[] mkDatatypeSorts(DatatypeDecl[] dtypedecls) throws CVC5ApiException
dtypedecls
- The datatype declarations from which the sort is created.CVC5ApiException
- on errorpublic Sort mkFunctionSort(Sort domain, Sort codomain)
domain
- The sort of the fuction argument.codomain
- The sort of the function return value.public Sort mkFunctionSort(Sort[] sorts, Sort codomain)
sorts
- The sort of the function arguments.codomain
- The sort of the function return value.public Sort mkParamSort(java.lang.String symbol)
symbol
- The name of the sort.public Sort mkParamSort()
public Term mkSkolem(SkolemId skolemId, Term[] indices)
skolemId
- The id of the skolem.indices
- The indices of the skolem.public int getNumIndicesForSkolemId(SkolemId id)
id
- The skolem id.public Sort mkPredicateSort(Sort[] sorts)
sorts
- The list of sorts of the predicate.public Sort mkRecordSort(Pair<java.lang.String,Sort>[] fields)
fields
- The list of fields of the record.public Sort mkSetSort(Sort elemSort)
elemSort
- The sort of the set elements.public Sort mkBagSort(Sort elemSort)
elemSort
- The sort of the bag elements.public Sort mkSequenceSort(Sort elemSort)
elemSort
- The sort of the sequence elements.public Sort mkAbstractSort(SortKind kind)
SortKind
k must be the kind of a sort that can be abstracted,
i.e., a sort that has indices or argument sorts. For example,
SortKind.ARRAY_SORT
and SortKind.BITVECTOR_SORT
can be
passed as the SortKind
k to this method, while
SortKind.INTEGER_SORT
and SortKind.STRING_SORT
cannot.kind
- The kind of the abstract sortSortKind.ABSTRACT_SORT
as an
argument to this method returns the (fully) unspecified sort,
often denoted ?
., Providing a kind k
that has no indices and a fixed arity
of argument sorts will return the sort of SortKind
k
whose arguments are the unspecified sort. For example,
mkAbstractSort(ARRAY_SORT)
will return the sort
(ARRAY_SORT ? ?)
instead of the abstract sort whose
abstract kind is SortKind.ABSTRACT_SORT
., This method is experimental and may change in future versions.public Sort mkUninterpretedSort(java.lang.String symbol)
symbol
- The name of the sort.public Sort mkUninterpretedSort()
public Sort mkUnresolvedDatatypeSort(java.lang.String symbol, int arity) throws CVC5ApiException
symbol
- The symbol of the sort.arity
- The number of sort parameters of the sort.CVC5ApiException
- on errorpublic Sort mkUnresolvedDatatypeSort(java.lang.String symbol) throws CVC5ApiException
symbol
- The symbol of the sort.CVC5ApiException
- on errorpublic Sort mkUninterpretedSortConstructorSort(int arity, java.lang.String symbol) throws CVC5ApiException
arity
- The arity of the sort (must be > 0)symbol
- The symbol of the sort.CVC5ApiException
- on errorpublic Sort mkUninterpretedSortConstructorSort(int arity) throws CVC5ApiException
arity
- The arity of the sort (must be > 0)CVC5ApiException
- on errorpublic Sort mkTupleSort(Sort[] sorts)
sorts
- Of the elements of the tuple.public Sort mkNullableSort(Sort sort)
sort
- The sort of the element of the nullable.public Term mkTerm(Kind kind)
kind
- The kind of the term.public Term mkTerm(Kind kind, Term child)
kind
- The kind of the term.child
- The child of the term.public Term mkTerm(Kind kind, Term child1, Term child2)
kind
- The kind of the term.child1
- The first child of the term.child2
- The second child of the term.public Term mkTerm(Kind kind, Term child1, Term child2, Term child3)
kind
- The kind of the term.child1
- The first child of the term.child2
- The second child of the term.child3
- The third child of the term.public Term mkTerm(Kind kind, Term[] children)
kind
- The kind of the term.children
- The children of the term.public Term mkTerm(Op op)
mkOp(Kind)
,
mkOp(Kind, String)
, mkOp(Kind, int[])
.op
- The operator.public Term mkTerm(Op op, Term child)
mkOp(Kind)
,
mkOp(Kind, String)
, mkOp(Kind, int[])
.op
- The operator.child
- The child of the term.public Term mkTerm(Op op, Term child1, Term child2)
mkOp(Kind)
,
mkOp(Kind, String)
, mkOp(Kind, int[])
.op
- The operator.child1
- The first child of the term.child2
- The second child of the term.public Term mkTerm(Op op, Term child1, Term child2, Term child3)
mkOp(Kind)
,
mkOp(Kind, String)
, mkOp(Kind, int[])
.op
- The operator.child1
- The first child of the term.child2
- The second child of the term.child3
- The third child of the term.public Term mkTerm(Op op, Term[] children)
mkOp(Kind)
,
mkOp(Kind, String)
, mkOp(Kind, int[])
.op
- The operator.children
- The children of the term.public Term mkTuple(Term[] terms)
terms
- The elements in the tuple.public Term mkNullableSome(Term term)
term
- The element value.public Term mkNullableVal(Term term)
term
- A nullable term.public Term mkNullableIsNull(Term term)
term
- A nullable term.public Term mkNullableIsSome(Term term)
term
- A nullable term.public Term mkNullableNull(Sort sort)
sort
- The sort of the Nullable element.public Term mkNullableLift(Kind kind, Term[] args)
kind
- The lifted operator.args
- The arguments of the lifted operator.public Op mkOp(Kind kind)
Kind.BITVECTOR_EXTRACT
).kind
- The kind to wrap.public Op mkOp(Kind kind, java.lang.String arg)
Kind.DIVISIBLE
(to support arbitrary precision integers)
Kind
for a description of the parameters.kind
- The kind of the operator.arg
- The string argument to this operator.public Op mkOp(Kind kind, int arg) throws CVC5ApiException
Kind
for a description of the parameters.kind
- The kind of the operator.arg
- The unsigned int argument to this operator.CVC5ApiException
- on errorpublic Op mkOp(Kind kind, int arg1, int arg2) throws CVC5ApiException
Kind
for a description of the parameters.kind
- The kind of the operator.arg1
- The first unsigned int argument to this operator.arg2
- The second unsigned int argument to this operator.CVC5ApiException
- on errorpublic Op mkOp(Kind kind, int[] args) throws CVC5ApiException
Kind
for a description of the parameters.kind
- The kind of the operator.args
- The arguments (indices) of the operator.CVC5ApiException
- on errorpublic Term mkTrue()
true
constant.public Term mkFalse()
false
constant.public Term mkBoolean(boolean val)
val
- The value of the constant.public Term mkPi()
public Term mkInteger(java.lang.String s) throws CVC5ApiException
s
- The string representation of the constant, may represent an.
integer (e.g., "123").s
represents an
integer).CVC5ApiException
- on errorpublic Term mkInteger(long val)
int
.val
- The value of the constant.public Term mkReal(java.lang.String s) throws CVC5ApiException
s
- The string representation of the constant, may represent an.
integer (e.g., "123") or real constant (e.g., "12.34" or
"12/34").CVC5ApiException
- on errorpublic Term mkReal(long val)
val
- The value of the constant.public Term mkReal(long num, long den)
num
- The value of the numerator.den
- The value of the denominator.public Term mkRegexpNone()
re.none
) term.public Term mkRegexpAll()
re.all
) term.public Term mkRegexpAllchar()
re.allchar
) term.public Term mkEmptySet(Sort sort)
sort
- The sort of the set elements.public Term mkEmptyBag(Sort sort)
sort
- The sort of the bag elements.public Term mkSepEmp()
public Term mkSepNil(Sort sort)
sort
- The sort of the nil term.public Term mkString(java.lang.String s)
s
- The string this constant represents.public Term mkString(java.lang.String s, boolean useEscSequences)
s
- The string this constant represents.useEscSequences
- Determines whether escape sequences in s
should be converted to the corresponding unicode
character.public Term mkString(int[] s) throws CVC5ApiException
s
- A list of unsigned (unicode) values this constant represents
as string.CVC5ApiException
- on errorpublic Term mkEmptySequence(Sort sort)
sort
- The element sort of the sequence.public Term mkUniverseSet(Sort sort)
sort
- The sort of the set elements.public Term mkBitVector(int size) throws CVC5ApiException
size
- The bit-width of the bit-vector sort.CVC5ApiException
- on errorpublic Term mkBitVector(int size, long val) throws CVC5ApiException
size
- The bit-width of the bit-vector sort.val
- The value of the constant.CVC5ApiException
- on errorpublic Term mkBitVector(int size, java.lang.String s, int base) throws CVC5ApiException
size
- The bit-width of the constant.s
- The string representation of the constant.base
- The base of the string representation (2, 10, or 16)CVC5ApiException
- on errorpublic Term mkFiniteFieldElem(java.lang.String val, Sort sort, int base) throws CVC5ApiException
val
- The value of the constant.sort
- The sort of the finite field.base
- The base of the string representation.CVC5ApiException
- on errorpublic Term mkConstArray(Sort sort, Term val)
sort
- The sort of the constant array (must be an array sort)val
- The constant value to store (must match the sort's element
sort).public Term mkFloatingPointPosInf(int exp, int sig) throws CVC5ApiException
+oo
).exp
- Number of bits in the exponent.sig
- Number of bits in the significand.CVC5ApiException
- on errorpublic Term mkFloatingPointNegInf(int exp, int sig) throws CVC5ApiException
-oo
).exp
- Number of bits in the exponent.sig
- Number of bits in the significand.CVC5ApiException
- on errorpublic Term mkFloatingPointNaN(int exp, int sig) throws CVC5ApiException
NaN
).exp
- Number of bits in the exponent.sig
- Number of bits in the significand.CVC5ApiException
- on errorpublic Term mkFloatingPointPosZero(int exp, int sig) throws CVC5ApiException
+zero
).exp
- Number of bits in the exponent.sig
- Number of bits in the significand.CVC5ApiException
- on errorpublic Term mkFloatingPointNegZero(int exp, int sig) throws CVC5ApiException
-zero
).exp
- Number of bits in the exponent.sig
- Number of bits in the significand.CVC5ApiException
- on errorpublic Term mkRoundingMode(RoundingMode rm)
rm
- The floating point rounding mode this constant represents.public Term mkFloatingPoint(int exp, int sig, Term val) throws CVC5ApiException
exp
- Size of the exponent.sig
- Size of the significand.val
- Value of the floating-point constant as a bit-vector term.CVC5ApiException
- on errorpublic Term mkFloatingPoint(Term sign, Term exp, Term sig) throws CVC5ApiException
sign
- The sign bit.exp
- The bit-vector representing the exponent.sig
- The bit-vector representing the significand.CVC5ApiException
- on errorpublic Term mkCardinalityConstraint(Sort sort, int upperBound) throws CVC5ApiException
sort
- The sort the cardinality constraint is for.upperBound
- The upper bound on the cardinality of the sort.CVC5ApiException
- on errorpublic Term mkConst(Sort sort, java.lang.String symbol)
( declare-const <symbol> <sort> )
( declare-fun <symbol> ( ) <sort> )
sort
- The sort of the constant.symbol
- The name of the constant.public Term mkConst(Sort sort)
sort
- The sort of the constant.public Term mkVar(Sort sort)
sort
- The sort of the variable.public Term mkVar(Sort sort, java.lang.String symbol)
sort
- The sort of the variable.symbol
- The name of the variable.public DatatypeConstructorDecl mkDatatypeConstructorDecl(java.lang.String name)
name
- The name of the datatype constructor.public DatatypeDecl mkDatatypeDecl(java.lang.String name)
name
- The name of the datatype.public DatatypeDecl mkDatatypeDecl(java.lang.String name, boolean isCoDatatype)
name
- The name of the datatype.isCoDatatype
- True if a codatatype is to be constructed.public DatatypeDecl mkDatatypeDecl(java.lang.String name, Sort[] params)
Solver.mkParamSort(String)
.name
- The name of the datatype.params
- A list of sort parameters.public DatatypeDecl mkDatatypeDecl(java.lang.String name, Sort[] params, boolean isCoDatatype)
Solver.mkParamSort(String)
.name
- The name of the datatype.params
- A list of sort parameters.isCoDatatype
- True if a codatatype is to be constructed.public long getPointer()
public void deletePointer()
public java.lang.String toString()
toString
in class java.lang.Object