public class DatatypeConstructor extends Object implements Iterable<DatatypeSelector>
| Modifier and Type | Class and Description |
|---|---|
class |
DatatypeConstructor.ConstIterator |
| Modifier and Type | Field and Description |
|---|---|
protected long |
pointer |
| Modifier and Type | Method and Description |
|---|---|
void |
deletePointer() |
protected void |
deletePointer(long pointer) |
boolean |
equals(Object c)
Syntactic equality operator.
|
Term |
getInstantiatedTerm(Sort retSort)
Get the constructor term of this datatype constructor whose return
type is
retSort. |
String |
getName() |
int |
getNumSelectors() |
long |
getPointer() |
DatatypeSelector |
getSelector(int index)
Get the DatatypeSelector at the given index
|
DatatypeSelector |
getSelector(String name)
Get the datatype selector with the given name.
|
Term |
getTerm()
Get the constructor term of this datatype constructor.
|
Term |
getTesterTerm()
Get the tester term of this datatype constructor.
|
int |
hashCode()
Get the hash value of a datatype constructor.
|
boolean |
isNull() |
Iterator<DatatypeSelector> |
iterator() |
String |
toString() |
protected String |
toString(long pointer) |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitforEach, spliteratorprotected void deletePointer(long pointer)
public boolean equals(Object c)
public String getName()
public Term getTerm()
Sort.isDatatypeConstructor()). All
datatype constructors, including nullary ones, should be used as the
first argument to Terms whose kind is Kind.APPLY_CONSTRUCTOR.
For example, the nil list is represented by the term
(APPLY_CONSTRUCTOR nil), where nil is the term returned by
this method.public Term getInstantiatedTerm(Sort retSort)
retSort.
This method is intended to be used on constructors of parametric datatypes
and can be seen as returning the constructor term that has been explicitly
cast to the given sort.
This method is required for constructors of parametric datatypes whose
return type cannot be determined by type inference. For example, given:
(declare-datatype List (par (T) ((nil) (cons (head T)
(tail (List T))))))
The type of nil terms need to be provided by the user. In SMT version 2.6,
this is done via the syntax for qualified identifiers:
(as nil (List Int))
This method is equivalent of applying the above, where this
DatatypeConstructor is the one corresponding to nil, and
retSort is (List Int).retSort - The desired return sort of the constructor.public Term getTesterTerm()
Sort.isDatatypeTester()), and should be used as the
first argument of Terms of kind Kind.APPLY_TESTER.public int getNumSelectors()
public DatatypeSelector getSelector(int index)
index - The given index i.public DatatypeSelector getSelector(String name)
name - The name of the datatype selector.public boolean isNull()
protected String toString(long pointer)
public Iterator<DatatypeSelector> iterator()
iterator in interface Iterable<DatatypeSelector>public int hashCode()
public long getPointer()
public void deletePointer()