Package io.github.cvc5
Class Datatype
java.lang.Object
io.github.cvc5.Datatype
- All Implemented Interfaces:
Iterable<DatatypeConstructor>
A cvc5 datatype.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
ConstIterator is an implementation of theIterator
interface for iterating over a collection ofDatatypeConstructor
objects. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
Free the native resource associated with this pointer.protected void
deletePointer
(long pointer) Delete the native resource associated with the specified pointer.boolean
Syntactic equality operator.getConstructor
(int idx) Get the datatype constructor at a given index.getConstructor
(String name) Get the datatype constructor with the given name.getName()
Get the name of this Datatype.int
Get the number of constructors for this Datatype.Sort[]
Get the parameters of this datatype.long
Return the raw native pointer.getSelector
(String name) Get the datatype constructor with the given name.int
hashCode()
Get the hash value of a datatype.boolean
Determine if this datatype corresponds to a co-datatype.boolean
isFinite()
Determine if this datatype is finite.boolean
isNull()
Determine if this Datatype is a null object.boolean
Determine if this datatype is parametric.boolean
isRecord()
Determine if this datatype corresponds to a record.boolean
isTuple()
Determine if this datatype corresponds to a tuple.boolean
Is this datatype well-founded? If this datatype is not a codatatype, this returns false if there are no values of this datatype that are of finite size.iterator()
toString()
Return a string representation of the pointer.protected String
toString
(long pointer) Provide a string representation of the native datatype.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
pointer
protected long pointerThe raw native pointer value.
-
-
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
Syntactic equality operator. -
getConstructor
Get the datatype constructor at a given index.- Parameters:
idx
- The index of the datatype constructor to return.- Returns:
- The datatype constructor with the given index.
-
getConstructor
Get the datatype constructor with the given name. This is a linear search through the constructors, so in case of multiple, similarly-named constructors, the first is returned.- Parameters:
name
- The name of the datatype constructor.- Returns:
- The datatype constructor with the given name.
-
getSelector
Get the datatype constructor with the given name. This is a linear search through the constructors and their selectors, so in case of multiple, similarly-named selectors, the first is returned.- Parameters:
name
- The name of the datatype selector.- Returns:
- The datatype selector with the given name.
-
getName
Get the name of this Datatype.- Returns:
- The name of this Datatype.
-
getNumConstructors
public int getNumConstructors()Get the number of constructors for this Datatype.- Returns:
- The number of constructors for this Datatype.
-
getParameters
Get the parameters of this datatype.- Returns:
- The parameters of this datatype, if it is parametric. An exception. is thrown if this datatype is not parametric.
- Note:
- This method is experimental and may change in future versions.
-
isParametric
public boolean isParametric()Determine if this datatype is parametric.- Returns:
- True if this datatype is parametric.
- Note:
- This method is experimental and may change in future versions.
-
isCodatatype
public boolean isCodatatype()Determine if this datatype corresponds to a co-datatype.- Returns:
- True if this datatype corresponds to a co-datatype.
-
isTuple
public boolean isTuple()Determine if this datatype corresponds to a tuple.- Returns:
- True if this datatype corresponds to a tuple.
-
isRecord
public boolean isRecord()Determine if this datatype corresponds to a record.- Returns:
- True if this datatype corresponds to a record.
- Note:
- This method is experimental and may change in future versions.
-
isFinite
public boolean isFinite()Determine if this datatype is finite.- Returns:
- True if this datatype is finite
-
isWellFounded
public boolean isWellFounded()Is this datatype well-founded? If this datatype is not a codatatype, this returns false if there are no values of this datatype that are of finite size.- Returns:
- True if this datatype is well-founded.
-
isNull
public boolean isNull()Determine if this Datatype is a null object.- Returns:
- True if this Datatype is a null object.
-
toString
Provide a string representation of the native datatype.- Parameters:
pointer
- The native memory address pointing to the datatype.- Returns:
- A string representation of this datatype.
-
iterator
- Specified by:
iterator
in interfaceIterable<DatatypeConstructor>
-
hashCode
public int hashCode()Get the hash value of a datatype. -
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.
-