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 classDatatype.ConstIterator
-
Field Summary
Fields Modifier and Type Field Description protected longpointer
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeletePointer()protected voiddeletePointer(long pointer)DatatypeConstructorgetConstructor(int idx)Get the datatype constructor at a given index.DatatypeConstructorgetConstructor(java.lang.String name)Get the datatype constructor with the given name.java.lang.StringgetName()intgetNumConstructors()Sort[]getParameters()longgetPointer()DatatypeSelectorgetSelector(java.lang.String name)Get the datatype constructor with the given name.booleanisCodatatype()booleanisFinite()booleanisNull()booleanisParametric()booleanisRecord()booleanisTuple()booleanisWellFounded()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.StringtoString()protected java.lang.StringtoString(long pointer)
-
-
-
Method Detail
-
deletePointer
protected void deletePointer(long pointer)
-
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:
iteratorin interfacejava.lang.Iterable<DatatypeConstructor>
-
getPointer
public long getPointer()
-
deletePointer
public void deletePointer()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-