Package io.github.cvc5
Class Datatype
- java.lang.Object
-
- io.github.cvc5.Datatype
-
- All Implemented Interfaces:
java.lang.Iterable<DatatypeConstructor>
public class Datatype extends java.lang.Object implements java.lang.Iterable<DatatypeConstructor>
A cvc5 datatype.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
Datatype.ConstIterator
-
Field Summary
Fields Modifier and Type Field Description protected long
pointer
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deletePointer()
protected void
deletePointer(long pointer)
boolean
equals(java.lang.Object dt)
Syntactic equality operator.DatatypeConstructor
getConstructor(int idx)
Get the datatype constructor at a given index.DatatypeConstructor
getConstructor(java.lang.String name)
Get the datatype constructor with the given name.java.lang.String
getName()
int
getNumConstructors()
Sort[]
getParameters()
long
getPointer()
DatatypeSelector
getSelector(java.lang.String name)
Get the datatype constructor with the given name.int
hashCode()
Get the hash value of a datatype.boolean
isCodatatype()
boolean
isFinite()
boolean
isNull()
boolean
isParametric()
boolean
isRecord()
boolean
isTuple()
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.java.util.Iterator<DatatypeConstructor>
iterator()
java.lang.String
toString()
protected java.lang.String
toString(long pointer)
-
-
-
Method Detail
-
deletePointer
protected void deletePointer(long pointer)
-
equals
public boolean equals(java.lang.Object dt)
Syntactic equality operator.- Overrides:
equals
in classjava.lang.Object
- Parameters:
dt
- The datatype to compare to for equality.- Returns:
- True if the datatypes are equal.
-
getConstructor
public DatatypeConstructor getConstructor(int idx)
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
public DatatypeConstructor getConstructor(java.lang.String name)
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
public DatatypeSelector getSelector(java.lang.String name)
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
public java.lang.String getName()
- Returns:
- The name of this Datatype.
-
getNumConstructors
public int getNumConstructors()
- Returns:
- The number of constructors for this Datatype.
-
getParameters
public Sort[] getParameters()
- 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()
- Returns:
- True if this datatype is parametric.
- Note:
- This method is experimental and may change in future versions.
-
isCodatatype
public boolean isCodatatype()
- Returns:
- True if this datatype corresponds to a co-datatype
-
isTuple
public boolean isTuple()
- Returns:
- True if this datatype corresponds to a tuple
-
isRecord
public boolean isRecord()
- Returns:
- True if this datatype corresponds to a record.
- Note:
- This method is experimental and may change in future versions.
-
isFinite
public boolean isFinite()
- 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()
- Returns:
- True if this Datatype is a null object.
-
toString
protected java.lang.String toString(long pointer)
- Returns:
- A string representation of this datatype.
-
iterator
public java.util.Iterator<DatatypeConstructor> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<DatatypeConstructor>
-
hashCode
public int hashCode()
Get the hash value of a datatype.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- The hash value.
-
getPointer
public long getPointer()
-
deletePointer
public void deletePointer()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-