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 TypeClassDescriptionclassConstIterator is an implementation of theIteratorinterface for iterating over a collection ofDatatypeConstructorobjects. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidFree the native resource associated with this pointer.protected voiddeletePointer(long pointer) Delete the native resource associated with the specified pointer.booleanSyntactic 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.intGet the number of constructors for this Datatype.Sort[]Get the parameters of this datatype.longReturn the raw native pointer.getSelector(String name) Get the datatype constructor with the given name.inthashCode()Get the hash value of a datatype.booleanDetermine if this datatype corresponds to a co-datatype.booleanisFinite()Determine if this datatype is finite.booleanisNull()Determine if this Datatype is a null object.booleanDetermine if this datatype is parametric.booleanisRecord()Determine if this datatype corresponds to a record.booleanisTuple()Determine if this datatype corresponds to a tuple.booleanIs 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 StringtoString(long pointer) Provide a string representation of the native datatype.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:
iteratorin 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.
-