Package io.github.cvc5
Class Sort
java.lang.Object
io.github.cvc5.Sort
- All Implemented Interfaces:
Comparable<Sort>
The sort of a cvc5 term.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Comparison for ordering on sorts.void
Free the native resource associated with this pointer.protected void
deletePointer
(long pointer) Delete the native resource associated with the specified pointer.boolean
Comparison for structural equality.Get the sort kind of an abstract sort, which denotes the kind of sorts that this abstract sort denotes.Get the array element sort of an array element sort.Get the array index sort of an array sort.Get the element sort of a bag sort.int
Get the bit-width of the bit-vector sort.Get the underlying datatype of a datatype sort.int
Get the arity of a datatype sort.int
Get the arity of a datatype constructor sort.Get the codomain sort of a datatype constructor sort.Sort[]
Get the domain sorts of a datatype constructor sort.Get the codomain sort of a datatype selector sort.Get the domain sort of a datatype selector sort.Get the codomain sort of a datatype tester sort, which is the Boolean sort.Get the domain sort of a datatype tester sort.Get the bit-width of the bit-vector sort.int
Get the bit-width of the exponent of the floating-point sort.int
Get the width of the significand of the floating-point sort.int
Get the arity of a function sort.Get the codomain sort of a function sort.Sort[]
Get the domain sorts of a function sort.Sort[]
Get the sorts used to instantiate the sort parameters of a parametric sort (parametric datatype or uninterpreted sort constructor sort, seeinstantiate(Sort[])
).getKind()
Get the kind of this sort.Get the element sort of a nullable sort.long
Return the raw native pointer.Get the element sort of a sequence sort.Get the element sort of a set sort.Get the raw symbol of the symbol.int
Get the length of a tuple sort.Sort[]
Get the element sorts of a tuple sort.Get the associated uninterpreted sort constructor of an instantiated uninterpreted sort.int
Get the arity of an uninterpreted sort constructor sort.int
hashCode()
Get the hash value of a sort.boolean
Determine if the sort has a symbol.instantiate
(Sort[] params) Instantiate a parameterized datatype sort or uninterpreted sort constructor sort.boolean
Determine if this is an abstract sort.boolean
isArray()
Determine if this is an array sort.boolean
isBag()
Determine if this is a Bag sort.boolean
Determine if this is a bit-vector sort (SMT-LIB:(_ BitVec i)
).boolean
Determine if this is the Boolean sort (SMT-LIB:Bool
).boolean
Determine if this is a datatype sort.boolean
Determine if this is a datatype constructor sort.boolean
Determine if this is a datatype selector sort.boolean
Determine if this is a datatype tester sort.boolean
Determine if this is a datatype updater sort.boolean
Determine if this is a finite field sort (SMT-LIB:(_ FiniteField i)
).boolean
Determine if this is a floatingpoint sort (SMT-LIB:(_ FloatingPoint eb sb)
).boolean
Determine if this is a function sort.boolean
Determine if this is an instantiated (parametric datatype or uninterpreted sort constructor) sort.boolean
Determine if this is the integer sort (SMT-LIB:Int
).boolean
isNull()
Determine if this is the null sort.boolean
Determine if this a nullable sort.boolean
Determine if this is a predicate sort.boolean
isReal()
Determine if this is the real sort (SMT-LIB:Real
).boolean
isRecord()
Determine if this is a record sort.boolean
isRegExp()
Determine if this is the regular expression sort (SMT-LIB:RegLan
).boolean
Determine if this is the rounding mode sort (SMT-LIB:RoundingMode
).boolean
Determine if this is a Sequence sort.boolean
isSet()
Determine if this is a Set sort.boolean
isString()
Determine if this is the string sort (SMT-LIB:String
)..boolean
isTuple()
Determine if this a tuple sort.boolean
Determine if this is an uninterpreted sort.boolean
Determine if this is an uninterpreted sort constructor.substitute
(Sort[] sorts, Sort[] replacements) Simultaneous substitution of Sorts.substitute
(Sort sort, Sort replacement) Substitution of Sorts.toString()
Return a string representation of the pointer.protected String
toString
(long pointer) Return a string representation of the specified native pointer.
-
Field Details
-
pointer
protected long pointerThe raw native pointer value.
-
-
Constructor Details
-
Sort
public Sort()Null sort
-
-
Method Details
-
deletePointer
protected void deletePointer(long pointer) Delete the native resource associated with the specified pointer.Subclasses must implement this method to provide resource-specific cleanup logic.
- Parameters:
pointer
- the native pointer to delete
-
equals
Comparison for structural equality. -
compareTo
Comparison for ordering on sorts.- Specified by:
compareTo
in interfaceComparable<Sort>
- Parameters:
s
- The sort to compare to.- Returns:
- A negative integer, zero, or a positive integer as this sort is less than, equal to, or greater than the specified sort.
-
getKind
Get the kind of this sort.- Returns:
- The kind of this sort.
- Throws:
CVC5ApiException
- on error- Note:
- This method is experimental and may change in future versions.
-
hasSymbol
public boolean hasSymbol()Determine if the sort has a symbol.- Returns:
- True if the sort has a symbol.
-
getSymbol
Get the raw symbol of the symbol.- Returns:
- The raw symbol of the symbol.
- Note:
- Asserts hasSymbol().
-
isNull
public boolean isNull()Determine if this is the null sort.- Returns:
- True if this Sort is the null sort.
-
isBoolean
public boolean isBoolean()Determine if this is the Boolean sort (SMT-LIB:Bool
).- Returns:
- True if this sort is the Boolean sort.
-
isInteger
public boolean isInteger()Determine if this is the integer sort (SMT-LIB:Int
).- Returns:
- True if this sort is the integer sort.
-
isReal
public boolean isReal()Determine if this is the real sort (SMT-LIB:Real
).- Returns:
- True if this sort is the real sort.
-
isString
public boolean isString()Determine if this is the string sort (SMT-LIB:String
)..- Returns:
- True if this sort is the string sort.
-
isRegExp
public boolean isRegExp()Determine if this is the regular expression sort (SMT-LIB:RegLan
).- Returns:
- True if this sort is the regular expression sort.
-
isRoundingMode
public boolean isRoundingMode()Determine if this is the rounding mode sort (SMT-LIB:RoundingMode
).- Returns:
- True if this sort is the rounding mode sort.
-
isBitVector
public boolean isBitVector()Determine if this is a bit-vector sort (SMT-LIB:(_ BitVec i)
).- Returns:
- True if this sort is a bit-vector sort.
-
isFiniteField
public boolean isFiniteField()Determine if this is a finite field sort (SMT-LIB:(_ FiniteField i)
).- Returns:
- True if this sort is a finite field sort.
-
isFloatingPoint
public boolean isFloatingPoint()Determine if this is a floatingpoint sort (SMT-LIB:(_ FloatingPoint eb sb)
).- Returns:
- True if this sort is a floating-point sort.
-
isDatatype
public boolean isDatatype()Determine if this is a datatype sort.- Returns:
- True if this sort is a datatype sort.
-
isDatatypeConstructor
public boolean isDatatypeConstructor()Determine if this is a datatype constructor sort.- Returns:
- True if this sort is a datatype constructor sort.
-
isDatatypeSelector
public boolean isDatatypeSelector()Determine if this is a datatype selector sort.- Returns:
- True if this sort is a datatype selector sort.
-
isDatatypeTester
public boolean isDatatypeTester()Determine if this is a datatype tester sort.- Returns:
- True if this sort is a datatype tester sort.
-
isDatatypeUpdater
public boolean isDatatypeUpdater()Determine if this is a datatype updater sort.- Returns:
- True if this sort is a datatype updater sort.
-
isFunction
public boolean isFunction()Determine if this is a function sort.- Returns:
- True if this sort is a function sort.
-
isPredicate
public boolean isPredicate()Determine if this is a predicate sort. A predicate sort is a function sort that maps to the Boolean sort. All predicate sorts are also function sorts.- Returns:
- True if this sort is a predicate sort.
-
isTuple
public boolean isTuple()Determine if this a tuple sort.- Returns:
- True if this sort is a tuple sort.
-
isNullable
public boolean isNullable()Determine if this a nullable sort.- Returns:
- True if this sort is a nullable sort.
-
isRecord
public boolean isRecord()Determine if this is a record sort.- Returns:
- True if the sort is a record sort.
- Note:
- This method is experimental and may change in future versions.
-
isArray
public boolean isArray()Determine if this is an array sort.- Returns:
- True if the sort is an array sort.
-
isSet
public boolean isSet()Determine if this is a Set sort.- Returns:
- True if the sort is a Set sort.
-
isBag
public boolean isBag()Determine if this is a Bag sort.- Returns:
- True if the sort is a Bag sort.
-
isSequence
public boolean isSequence()Determine if this is a Sequence sort.- Returns:
- True if the sort is a Sequence sort.
-
isAbstract
public boolean isAbstract()Determine if this is an abstract sort.- Returns:
- True if the sort is a abstract sort.
- Note:
- This method is experimental and may change in future versions.
-
isUninterpretedSort
public boolean isUninterpretedSort()Determine if this is an uninterpreted sort.- Returns:
- True if this is an uninterpreted sort.
-
isUninterpretedSortConstructor
public boolean isUninterpretedSortConstructor()Determine if this is an uninterpreted sort constructor. An uninterpreted sort constructor has arity > 0 and can be instantiated to construct uninterpreted sorts with given sort parameters.- Returns:
- True if this is a sort constructor kind.
-
isInstantiated
public boolean isInstantiated()Determine if this is an instantiated (parametric datatype or uninterpreted sort constructor) sort. An instantiated sort is a sort that has been constructed from instantiating a sort with sort arguments (seeinstantiate(Sort[])
).- Returns:
- True if this is an instantiated sort.
-
getUninterpretedSortConstructor
Get the associated uninterpreted sort constructor of an instantiated uninterpreted sort.- Returns:
- The uninterpreted sort constructor sort.
-
getDatatype
Get the underlying datatype of a datatype sort.- Returns:
- The underlying datatype of a datatype sort.
-
instantiate
Instantiate a parameterized datatype sort or uninterpreted sort constructor sort. Create sorts parameter withTermManager.mkParamSort(String)
).- Parameters:
params
- The list of sort parameters to instantiate with.- Returns:
- The instantiated sort.
- Note:
- This method is experimental and may change in future versions.
-
getInstantiatedParameters
Get the sorts used to instantiate the sort parameters of a parametric sort (parametric datatype or uninterpreted sort constructor sort, seeinstantiate(Sort[])
).- Returns:
- The sorts used to instantiate the sort parameters of a parametric sort.
-
substitute
Substitution of Sorts.- Parameters:
sort
- The subsort to be substituted within this sort.replacement
- The sort replacing the substituted subsort.- Returns:
- The sort yielded by substituting the replacement sort within the given sort.
- Note:
- This replacement is applied during a pre-order traversal and only once to the sort. It is not run until fix point., This method is experimental and may change in future versions.
-
substitute
Simultaneous substitution of Sorts. Note that this replacement is applied during a pre-order traversal and only once to the sort. It is not run until fix point. In the case that sorts contains duplicates, the replacement earliest in the list takes priority. For example,(Array A B).substitute({A, C}, {(Array C D), (Array A B)})
will return(Array (Array C D) B)
.- Parameters:
sorts
- The subsorts to be substituted within this sort.replacements
- The sort replacing the substituted subsorts.- Returns:
- The sorts yielded by substituting the replacement sort within the given sorts.
- Note:
- This method is experimental and may change in future versions.
-
toString
Return a string representation of the specified native pointer.Subclasses must implement this method to convert the native pointer into a meaningful string.
- Parameters:
pointer
- the native pointer- Returns:
- A string representation of this sort.
-
getDatatypeConstructorArity
public int getDatatypeConstructorArity()Get the arity of a datatype constructor sort.- Returns:
- The arity of a datatype constructor sort.
-
getDatatypeConstructorDomainSorts
Get the domain sorts of a datatype constructor sort.- Returns:
- The domain sorts of a datatype constructor sort.
-
getDatatypeConstructorCodomainSort
Get the codomain sort of a datatype constructor sort.- Returns:
- The codomain sort of a datatype constructor sort.
-
getDatatypeSelectorDomainSort
Get the domain sort of a datatype selector sort.- Returns:
- The domain sort of a datatype selector sort.
-
getDatatypeSelectorCodomainSort
Get the codomain sort of a datatype selector sort.- Returns:
- The codomain sort of a datatype selector sort.
-
getDatatypeTesterDomainSort
Get the domain sort of a datatype tester sort.- Returns:
- The domain sort of a datatype tester sort.
-
getDatatypeTesterCodomainSort
Get the codomain sort of a datatype tester sort, which is the Boolean sort.- Returns:
- The codomain sort of a datatype tester sort, which is the Boolean sort.
-
getFunctionArity
public int getFunctionArity()Get the arity of a function sort.- Returns:
- The arity of a function sort.
-
getFunctionDomainSorts
Get the domain sorts of a function sort.- Returns:
- The domain sorts of a function sort.
-
getFunctionCodomainSort
Get the codomain sort of a function sort.- Returns:
- The codomain sort of a function sort.
-
getArrayIndexSort
Get the array index sort of an array sort.- Returns:
- The array index sort of an array sort.
-
getArrayElementSort
Get the array element sort of an array element sort.- Returns:
- The array element sort of an array element sort.
-
getSetElementSort
Get the element sort of a set sort.- Returns:
- The element sort of a set sort.
-
getBagElementSort
Get the element sort of a bag sort.- Returns:
- The element sort of a bag sort.
-
getSequenceElementSort
Get the element sort of a sequence sort.- Returns:
- The element sort of a sequence sort.
-
getAbstractedKind
Get the sort kind of an abstract sort, which denotes the kind of sorts that this abstract sort denotes.- Returns:
- The sort kind of an abstract sort, which denotes the kind of sorts that this abstract sort denotes.
- Throws:
CVC5ApiException
- on error- Note:
- This method is experimental and may change in future versions.
-
getUninterpretedSortConstructorArity
public int getUninterpretedSortConstructorArity()Get the arity of an uninterpreted sort constructor sort.- Returns:
- The arity of an uninterpreted sort constructor sort.
-
getBitVectorSize
public int getBitVectorSize()Get the bit-width of the bit-vector sort.- Returns:
- The bit-width of the bit-vector sort.
-
getFiniteFieldSize
Get the bit-width of the bit-vector sort.- Returns:
- The bit-width of the bit-vector sort.
-
getFloatingPointExponentSize
public int getFloatingPointExponentSize()Get the bit-width of the exponent of the floating-point sort.- Returns:
- The bit-width of the exponent of the floating-point sort.
-
getFloatingPointSignificandSize
public int getFloatingPointSignificandSize()Get the width of the significand of the floating-point sort.- Returns:
- The width of the significand of the floating-point sort.
-
getDatatypeArity
public int getDatatypeArity()Get the arity of a datatype sort.- Returns:
- The arity of a datatype sort.
-
getTupleLength
public int getTupleLength()Get the length of a tuple sort.- Returns:
- The length of a tuple sort.
-
getTupleSorts
Get the element sorts of a tuple sort.- Returns:
- The element sorts of a tuple sort.
-
getNullableElementSort
Get the element sort of a nullable sort.- Returns:
- The element sort of a nullable sort.
-
hashCode
public int hashCode()Get the hash value of a sort. -
getPointer
public long getPointer()Return the raw native pointer.- Returns:
- the pointer value
-
deletePointer
public void deletePointer()Free the native resource associated with this pointer.This method should be called to explicitly clean up the underlying native resource. It removes this instance from the
Context
, then invokes the subclass-defineddeletePointer(long)
method to perform the actual cleanup. -
toString
Return a string representation of the pointer.
-