Class DatatypeDecl

java.lang.Object
io.github.cvc5.DatatypeDecl

public class DatatypeDecl extends Object
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
    Modifier and Type
    Field
    Description
    protected long
    The raw native pointer value.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Null datatypeDecl
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Add datatype constructor declaration.
    void
    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.
    Get the name of this datatype declaration.
    int
    Get the number of constructors (so far) for this Datatype declaration.
    long
    Return the raw native pointer.
    int
    Get the hash value of a datatype declaration.
    boolean
    Determine if this DatatypeDecl is a null object.
    boolean
    Determine if this datatype declaration is parametric.
    Return a string representation of the pointer.
    protected String
    toString(long pointer)
    Return a string representation of the specified native pointer.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • pointer

      protected long pointer
      The raw native pointer value.
  • Constructor Details

    • DatatypeDecl

      public DatatypeDecl()
      Null datatypeDecl
  • 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

      public boolean equals(Object d)
      Syntactic equality operator.
      Overrides:
      equals in class Object
      Parameters:
      d - The datatype declaration to compare to for equality.
      Returns:
      True if the datatype declarations are equal.
    • addConstructor

      public void addConstructor(DatatypeConstructorDecl ctor)
      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

      protected String toString(long pointer)
      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

      public String 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.
      Overrides:
      hashCode in class Object
      Returns:
      The hash value.
    • 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-defined deletePointer(long) method to perform the actual cleanup.

    • toString

      public String toString()
      Return a string representation of the pointer.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the pointer