Package io.github.cvc5
Class DatatypeDecl
java.lang.Object
io.github.cvc5.DatatypeDecl
A cvc5 datatype declaration. A datatype declaration is not itself a datatype
(see
Datatype), but a specification for creating a datatype sort.
The interface for a datatype declaration coincides with the syntax for the
SMT-LIB 2.6 command declare-datatype, or a single datatype within the
declare-datatypes command.
Datatype sorts can be constructed from DatatypeDecl using the methods:
- Solver.mkDatatypeSort(DatatypeDecl)
- Solver.mkDatatypeSorts(DatatypeDecl[])-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd datatype constructor declaration.voidFree the native resource associated with this pointer.booleanSyntactic equality operator.getName()Get the name of this datatype declaration.intGet the number of constructors (so far) for this Datatype declaration.longReturn the raw native pointer.inthashCode()Get the hash value of a datatype declaration.booleanisNull()Determine if this DatatypeDecl is a null object.booleanDetermine if this datatype declaration is parametric.toString()Return a string representation of the pointer.protected StringtoString(long pointer) Return a string representation of the specified native pointer.
-
Field Details
-
pointer
protected long pointerThe raw native pointer value.
-
-
Constructor Details
-
DatatypeDecl
public DatatypeDecl()Null datatypeDecl
-
-
Method Details
-
equals
Syntactic equality operator. -
addConstructor
Add datatype constructor declaration.- Parameters:
ctor- The datatype constructor declaration to add.
-
getNumConstructors
public int getNumConstructors()Get the number of constructors (so far) for this Datatype declaration.- Returns:
- The number of constructors.
-
isParametric
public boolean isParametric()Determine if this datatype declaration is parametric.- Returns:
- True if this DatatypeDecl is parametric.
- Note:
- This method is experimental and may change in future versions.
-
isNull
public boolean isNull()Determine if this DatatypeDecl is a null object.- Returns:
- True if this DatatypeDecl is a null object.
-
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 datatype declaration.
-
getName
Get the name of this datatype declaration.- Returns:
- The name of this datatype declaration.
-
hashCode
public int hashCode()Get the hash value of a datatype declaration. -
getPointer
public long getPointer()Return the raw native pointer.Every native call obtains the pointers of the objects it uses through this method, so that using an object after its native resource has been released raises an exception instead of crashing the JVM.
- Returns:
- the pointer value
- Throws:
IllegalStateException- if the native resource of this object has been released, e.g., viadeletePointer()
-
deletePointer
public void deletePointer()Free the native resource associated with this pointer.Native resources are freed automatically once the Java object is no longer reachable. This method frees the native resource immediately instead; afterwards, using the object raises an
IllegalStateException. It must be called from the thread that is using the associated term manager. Calling it more than once has no further effect. -
toString
Return a string representation of the pointer.
-