API reference

Term and Op

Terms are the expressions that cvc5 reasons about. An operator is an indexed kind, such as bit-vector extraction, that TermManager.mkTerm applies to terms.

Term

A cvc5 Term.

Wrapper class for Term.

69 of the 69 mirrored methods of Term are generated.

Method Summary Binding Mojo
__eq__ rule ✓
__ne__ rule ✓
__lt__ rule ✓
__gt__ rule ✓
__le__ rule ✓
__ge__ rule ✓
__getitem__ Get the child term at a given index. override ✓
__str__ auto ✓
__repr__ auto ✓
__iter__ Iterate over all child terms. override ✓
__hash__ rule ✓
getNumChildren Returns the number of children of this term. auto ✓
getId Returns the id of this term. auto ✓
getKind Returns the Kind of this term. auto ✓
getSort Returns the Sort of this term. auto ✓
substitute Returns the result of simultaneously replacing the term(s) stored in term_or_list_1 by the term(s) stored in term_or_list_2 in this term. overloaded ✓
hasOp Returns true iff this term has an operator. auto ✓
getOp Returns the Op used to create this Term. auto ✓
hasSymbol Returns true iff this term has a symbol. auto ✓
getSymbol ..note:: Asserts hasSymbol(). auto ✓
isNull Returns true iff this term is a null term. rule ✓
notTerm Boolean negation. override ✓
andTerm Boolean and. override ✓
orTerm Boolean or. override ✓
xorTerm Boolean exclusive or. override ✓
eqTerm Equality override ✓
impTerm Boolean Implication. override ✓
iteTerm If-then-else with this term as the Boolean condition. override ✓
isConstArray Returns true iff this term is a constant array. auto ✓
getConstArrayBase Returns the base (element stored at all indicies) of this constant array. auto ✓
isBooleanValue Returns true iff this term is a Boolean value. auto ✓
getBooleanValue Returns the representation of a Boolean value as a native Boolean value. auto ✓
isStringValue Returns true iff this term is a string value. auto ✓
getStringValue Returns the string term as a native string value. manual ✓
getRealOrIntegerValueSign Get integer or real value sign. auto ✓
isIntegerValue Returns true iff this term is an integer value. auto ✓
getIntegerValue Returns the integer term as a native python integer. manual ✓
isFloatingPointPosZero Returns true iff the term is the floating-point value for positive zero. auto ✓
isFloatingPointNegZero Returns true iff the term is the floating-point value for negative zero. auto ✓
isFloatingPointPosInf Returns true iff the term is the floating-point value for positive infinity. auto ✓
isFloatingPointNegInf Returns true iff the term is the floating-point value for negative infinity. auto ✓
isFloatingPointNaN Returns true iff the term is the floating-point value for not a number. auto ✓
isFloatingPointValue Returns true iff this term is a floating-point value. auto ✓
getFloatingPointValue Returns the representation of a floating-point value as a tuple of the exponent width, the significand width and a bit-vector value. auto ✓
isSetValue A term is a set value if it is considered to be a (canonical) constant set value. auto ✓
getSetValue Returns the representation of a set value as a set of terms. auto ✓
isSequenceValue Returns true iff this term is a sequence value. auto ✓
getSequenceValue Returns the representation of a sequence value as a vector of terms. auto ✓
isCardinalityConstraint Returns true if the term is a cardinality constraint. auto ✓
getCardinalityConstraint Returns the sort the cardinality constraint is for and its upper bound. auto ✓
isRealAlgebraicNumber Returns true if the term is a real algebraic number. auto ✓
getRealAlgebraicNumberDefiningPolynomial Returns the defining polynomial for the real algebraic number, expressed in terms of the given variable. auto ✓
getRealAlgebraicNumberLowerBound Returns the lower bound for the value of the real algebraic number. auto ✓
getRealAlgebraicNumberUpperBound Returns the upper bound for the value of the real algebraic number. auto ✓
isSkolem Returns true if the term is a skolem. auto ✓
getSkolemId Get skolem identifier of this term. auto ✓
getSkolemIndices Returns the skolem indices of this term. auto ✓
isUninterpretedSortValue Returns true iff this term is a value from an uninterpreted sort. auto ✓
getUninterpretedSortValue Returns the representation of an uninterpreted value as a pair of its sort and its index. auto ✓
isTupleValue Returns true iff this term is a tuple value. auto ✓
isRoundingModeValue Returns true if the term is a floating-point rounding mode value. auto ✓
getRoundingModeValue Returns the floating-point rounding mode value held by the term. auto ✓
getTupleValue Returns the representation of a tuple value as a vector of terms. auto ✓
isRealValue Returns true iff this term is a rational value. auto ✓
getRealValue Returns the representation of a rational value as a python Fraction. manual ✓
isBitVectorValue Returns true iff this term is a bit-vector value. auto ✓
getBitVectorValue Returns the representation of a bit-vector value in string representation. auto ✓
isFiniteFieldValue Returns true iff this term is a finite field value. auto ✓
getFiniteFieldValue Returns the representation of a finite field value as an integer. auto ✓

Term.__eq__

Mojo declaration:

def __eq__(self, other: Self) -> Bool

Upstream Python signature:

Term.__eq__(other: Term)

Binding: Generated by a rule from cvc5_term_is_equal.

Term.__ne__

Mojo declaration:

def __ne__(self, other: Self) -> Bool

Upstream Python signature:

Term.__ne__(other: Term)

Binding: Generated by a rule from cvc5_term_is_disequal.

Term.__lt__

Mojo declaration:

def __lt__(self, other: Self) -> Bool

Upstream Python signature:

Term.__lt__(other: Term)

Binding: Generated by a rule from cvc5_term_compare.

Term.__gt__

Mojo declaration:

def __gt__(self, other: Self) -> Bool

Upstream Python signature:

Term.__gt__(other: Term)

Binding: Generated by a rule from cvc5_term_compare.

Term.__le__

Mojo declaration:

def __le__(self, other: Self) -> Bool

Upstream Python signature:

Term.__le__(other: Term)

Binding: Generated by a rule from cvc5_term_compare.

Term.__ge__

Mojo declaration:

def __ge__(self, other: Self) -> Bool

Upstream Python signature:

Term.__ge__(other: Term)

Binding: Generated by a rule from cvc5_term_compare.

Term.__getitem__

Mojo declaration:

def __getitem__(self, index: Int) raises -> Term
def __getitem__(self, index: IntLiteral) raises -> Term

Upstream Python signature:

Term.__getitem__(index: int)

Get the child term at a given index.

Parameters

  • index: The index of the child term to return.

Returns

The child term with the given index.

Binding: Bound to cvc5_term_get_child by bindgen/overrides.toml.

Term.__str__

Mojo declaration:

def toString(self) -> String
def write_to(self, mut writer: Some[Writer])

Upstream Python signature:

Term.__str__()

Mojo uses the Writable protocol here: call String(value), repr(value), or print(value).

Binding: Generated from cvc5_term_to_string.

Term.__repr__

Mojo declaration:


Upstream Python signature:

Term.__repr__()

Mojo uses the Writable protocol here: call String(value), repr(value), or print(value).

Binding: Generated from cvc5_term_to_string.

Term.__iter__

Mojo declaration:

def __iter__(self) raises -> OwnedIterator[Term]

Upstream Python signature:

Term.__iter__()

Iterate over all child terms.

Binding: Bound to cvc5_term_get_num_children, cvc5_term_get_child by bindgen/overrides.toml.

Term.__hash__

Mojo declaration:

def __hash__[H: Hasher](self, mut hasher: H)

Upstream Python signature:

Term.__hash__()

Binding: Generated by a rule from cvc5_term_hash.

Term.getNumChildren

Mojo declaration:

def getNumChildren(self) raises -> Int

Upstream Python signature:

Term.getNumChildren()

Returns

The number of children of this term.

Binding: Generated from cvc5_term_get_num_children.

Term.getId

Mojo declaration:

def getId(self) raises -> UInt64

Upstream Python signature:

Term.getId()

Returns

The id of this term.

Binding: Generated from cvc5_term_get_id.

Term.getKind

Mojo declaration:

def getKind(self) raises -> Kind

Upstream Python signature:

Term.getKind()

Returns

The Kind of this term.

Binding: Generated from cvc5_term_get_kind.

Term.getSort

Mojo declaration:

def getSort(self) raises -> Sort

Upstream Python signature:

Term.getSort()

Returns

The Sort of this term.

Binding: Generated from cvc5_term_get_sort.

Term.substitute

Mojo declaration:

def substitute(self, t: Term, replacement: Term) raises -> Term
def substitute(self, terms: List[Term], replacements: List[Term]) raises -> Term

Upstream Python signature:

Term.substitute(term_or_list_1, term_or_list_2)

Note

This replacement is applied during a pre-order traversal and only once to the term. It is not run until fix point. In the case that terms contains duplicates, the replacement earliest in the list takes priority. For example, calling substitute on f(x,y) with

python term_or_list_1 = [ x, z ], term_or_list_2 = [ g(z), w ]

results in the term f(g(z),y).

Returns

The result of simultaneously replacing the term(s) stored in term_or_list_1 by the term(s) stored in term_or_list_2 in this term.

Binding: Generated as overloads from cvc5_term_substitute_term, cvc5_term_substitute_terms.

Term.hasOp

Mojo declaration:

def hasOp(self) raises -> Bool

Upstream Python signature:

Term.hasOp()

Returns

True iff this term has an operator.

Binding: Generated from cvc5_term_has_op.

Term.getOp

Mojo declaration:

def getOp(self) raises -> Op

Upstream Python signature:

Term.getOp()

Note

This is safe to call when hasOp() returns True.

Returns

The Op used to create this Term.

Binding: Generated from cvc5_term_get_op.

Term.hasSymbol

Mojo declaration:

def hasSymbol(self) raises -> Bool

Upstream Python signature:

Term.hasSymbol()

Returns

True iff this term has a symbol.

Binding: Generated from cvc5_term_has_symbol.

Term.getSymbol

Mojo declaration:

def getSymbol(self) raises -> String

Upstream Python signature:

Term.getSymbol()

..note:: Asserts hasSymbol().

Returns

The raw symbol of the term.

Binding: Generated from cvc5_term_get_symbol.

Term.isNull

Mojo declaration:

def isNull(self) -> Bool

Upstream Python signature:

Term.isNull()

Returns

True iff this term is a null term.

Binding: Generated by a rule: a check for a NULL handle, which is how the C API represents a null object.

Term.notTerm

Mojo declaration:

def notTerm(self) raises -> Term

Upstream Python signature:

Term.notTerm()

Boolean negation.

Returns

The Boolean negation of this term.

Binding: Bound to cvc5_mk_term by bindgen/overrides.toml.

Term.andTerm

Mojo declaration:

def andTerm(self, t: Term) raises -> Term

Upstream Python signature:

Term.andTerm(t: Term)

Boolean and.

Parameters

  • t: A Boolean term.

Returns

The conjunction of this term and the given term.

Binding: Bound to cvc5_mk_term by bindgen/overrides.toml.

Term.orTerm

Mojo declaration:

def orTerm(self, t: Term) raises -> Term

Upstream Python signature:

Term.orTerm(t: Term)

Boolean or.

Parameters

  • t: A Boolean term.

Returns

The disjunction of this term and the given term.

Binding: Bound to cvc5_mk_term by bindgen/overrides.toml.

Term.xorTerm

Mojo declaration:

def xorTerm(self, t: Term) raises -> Term

Upstream Python signature:

Term.xorTerm(t: Term)

Boolean exclusive or.

Parameters

  • t: A Boolean term.

Returns

The exclusive disjunction of this term and the given term.

Binding: Bound to cvc5_mk_term by bindgen/overrides.toml.

Term.eqTerm

Mojo declaration:

def eqTerm(self, t: Term) raises -> Term

Upstream Python signature:

Term.eqTerm(t: Term)

Equality

Parameters

  • t: A Boolean term.

Returns

The Boolean equivalence of this term and the given term.

Binding: Bound to cvc5_mk_term by bindgen/overrides.toml.

Term.impTerm

Mojo declaration:

def impTerm(self, t: Term) raises -> Term

Upstream Python signature:

Term.impTerm(t: Term)

Boolean Implication.

Parameters

  • t: A Boolean term.

Returns

The implication of this term and the given term.

Binding: Bound to cvc5_mk_term by bindgen/overrides.toml.

Term.iteTerm

Mojo declaration:

def iteTerm(self, then_t: Term, else_t: Term) raises -> Term

Upstream Python signature:

Term.iteTerm(then_t: Term, else_t: Term)

If-then-else with this term as the Boolean condition.

Parameters

  • then_t: The then term.
  • else_t: The else term.

Returns

The if-then-else term with this term as the Boolean condition.

Binding: Bound to cvc5_mk_term by bindgen/overrides.toml.

Term.isConstArray

Mojo declaration:

def isConstArray(self) raises -> Bool

Upstream Python signature:

Term.isConstArray()

Returns

True iff this term is a constant array.

Binding: Generated from cvc5_term_is_const_array.

Term.getConstArrayBase

Mojo declaration:

def getConstArrayBase(self) raises -> Term

Upstream Python signature:

Term.getConstArrayBase()

Note

Asserts isConstArray().

Returns

The base (element stored at all indicies) of this constant array.

Binding: Generated from cvc5_term_get_const_array_base.

Term.isBooleanValue

Mojo declaration:

def isBooleanValue(self) raises -> Bool

Upstream Python signature:

Term.isBooleanValue()

Returns

True iff this term is a Boolean value.

Binding: Generated from cvc5_term_is_boolean_value.

Term.getBooleanValue

Mojo declaration:

def getBooleanValue(self) raises -> Bool

Upstream Python signature:

Term.getBooleanValue()

Note

Asserts isBooleanValue()

Returns

The representation of a Boolean value as a native Boolean value.

Binding: Generated from cvc5_term_get_boolean_value.

Term.isStringValue

Mojo declaration:

def isStringValue(self) raises -> Bool

Upstream Python signature:

Term.isStringValue()

Returns

True iff this term is a string value.

Binding: Generated from cvc5_term_is_string_value.

Term.getStringValue

Mojo declaration:

def getStringValue(self) raises -> String

Upstream Python signature:

Term.getStringValue()

Note

Asserts isStringValue().

Note

This function is not to be confused with __str__() which returns the term in some string representation, whatever data it may hold.

Returns

The string term as a native string value.

Binding: Hand-written using cvc5_term_get_u32string_value, cvc5_term_to_string. The C UTF-32 getter has no length. Validate with it, then decode the lossless SMT-LIB representation to preserve embedded NUL..

Term.getRealOrIntegerValueSign

Mojo declaration:

def getRealOrIntegerValueSign(self) raises -> Int

Upstream Python signature:

Term.getRealOrIntegerValueSign()

Get integer or real value sign. Must be called on integer or real values, or otherwise an exception is thrown.

Returns

0 if this term is zero, -1 if this term is a negative real or integer value, 1 if this term is a positive real or integer value.

Binding: Generated from cvc5_term_get_real_or_integer_value_sign.

Term.isIntegerValue

Mojo declaration:

def isIntegerValue(self) raises -> Bool

Upstream Python signature:

Term.isIntegerValue()

Returns

True iff this term is an integer value.

Binding: Generated from cvc5_term_is_integer_value.

Term.getIntegerValue

Mojo declaration:

def getIntegerValue(self) raises -> Integer

Upstream Python signature:

Term.getIntegerValue()

Note

Asserts isIntegerValue().

Returns

The integer term as a native python integer.

Binding: Hand-written using cvc5_term_is_int64_value, cvc5_term_get_int64_value, cvc5_term_is_uint64_value, cvc5_term_get_uint64_value, cvc5_term_get_integer_value. Use exact native integer getters when representable; retain decimal parsing for arbitrary precision..

Term.isFloatingPointPosZero

Mojo declaration:

def isFloatingPointPosZero(self) raises -> Bool

Upstream Python signature:

Term.isFloatingPointPosZero()

Returns

True iff the term is the floating-point value for positive zero.

Binding: Generated from cvc5_term_is_fp_pos_zero.

Term.isFloatingPointNegZero

Mojo declaration:

def isFloatingPointNegZero(self) raises -> Bool

Upstream Python signature:

Term.isFloatingPointNegZero()

Returns

True iff the term is the floating-point value for negative zero.

Binding: Generated from cvc5_term_is_fp_neg_zero.

Term.isFloatingPointPosInf

Mojo declaration:

def isFloatingPointPosInf(self) raises -> Bool

Upstream Python signature:

Term.isFloatingPointPosInf()

Returns

True iff the term is the floating-point value for positive infinity.

Binding: Generated from cvc5_term_is_fp_pos_inf.

Term.isFloatingPointNegInf

Mojo declaration:

def isFloatingPointNegInf(self) raises -> Bool

Upstream Python signature:

Term.isFloatingPointNegInf()

Returns

True iff the term is the floating-point value for negative infinity.

Binding: Generated from cvc5_term_is_fp_neg_inf.

Term.isFloatingPointNaN

Mojo declaration:

def isFloatingPointNaN(self) raises -> Bool

Upstream Python signature:

Term.isFloatingPointNaN()

Returns

True iff the term is the floating-point value for not a number.

Binding: Generated from cvc5_term_is_fp_nan.

Term.isFloatingPointValue

Mojo declaration:

def isFloatingPointValue(self) raises -> Bool

Upstream Python signature:

Term.isFloatingPointValue()

Returns

True iff this term is a floating-point value.

Binding: Generated from cvc5_term_is_fp_value.

Term.getFloatingPointValue

Mojo declaration:

def getFloatingPointValue(self) raises -> Tuple[Int, Int, Term]

Upstream Python signature:

Term.getFloatingPointValue()

Note

Asserts isFloatingPointValue().

Returns

The representation of a floating-point value as a tuple of the exponent width, the significand width and a bit-vector value.

Binding: Generated from cvc5_term_get_fp_value.

Term.isSetValue

Mojo declaration:

def isSetValue(self) raises -> Bool

Upstream Python signature:

Term.isSetValue()

A term is a set value if it is considered to be a (canonical) constant set value. A canonical set value is one whose AST is:

(set.union
    (set.singleton c1) ...
    (set.union (set.singleton c_{n-1}) (set.singleton c_n))))

where c_1 \dots c_n are values ordered by id such that c_1 > \cdots > c_n.

Note

A universe set term (kind SET_UNIVERSE) is not considered to be a set value.

Returns

True if the term is a set value.

Binding: Generated from cvc5_term_is_set_value.

Term.getSetValue

Mojo declaration:

def getSetValue(self) raises -> List[Term]

Upstream Python signature:

Term.getSetValue()

Note

Asserts isSetValue().

Returns

The representation of a set value as a set of terms.

Binding: Generated from cvc5_term_get_set_value.

Term.isSequenceValue

Mojo declaration:

def isSequenceValue(self) raises -> Bool

Upstream Python signature:

Term.isSequenceValue()

Returns

True iff this term is a sequence value.

Binding: Generated from cvc5_term_is_sequence_value.

Term.getSequenceValue

Mojo declaration:

def getSequenceValue(self) raises -> List[Term]

Upstream Python signature:

Term.getSequenceValue()

Note

Asserts isSequenceValue().

Note

It is usually necessary for sequences to call Solver.simplify() to turn a sequence that is constructed by, e.g., concatenation of unit sequences, into a sequence value.

Returns

The representation of a sequence value as a vector of terms.

Binding: Generated from cvc5_term_get_sequence_value.

Term.isCardinalityConstraint

Mojo declaration:

def isCardinalityConstraint(self) raises -> Bool

Upstream Python signature:

Term.isCardinalityConstraint()

Warning

This function is experimental and may change in future versions.

Returns

True if the term is a cardinality constraint.

Binding: Generated from cvc5_term_is_cardinality_constraint.

Term.getCardinalityConstraint

Mojo declaration:

def getCardinalityConstraint(self) raises -> Tuple[Sort, Int]

Upstream Python signature:

Term.getCardinalityConstraint()

Note

Asserts isCardinalityConstraint().

Warning

This function is experimental and may change in future versions.

Returns

The sort the cardinality constraint is for and its upper bound.

Binding: Generated from cvc5_term_get_cardinality_constraint.

Term.isRealAlgebraicNumber

Mojo declaration:

def isRealAlgebraicNumber(self) raises -> Bool

Upstream Python signature:

Term.isRealAlgebraicNumber()

Warning

This function is experimental and may change in future versions.

Returns

True if the term is a real algebraic number.

Binding: Generated from cvc5_term_is_real_algebraic_number.

Term.getRealAlgebraicNumberDefiningPolynomial

Mojo declaration:

def getRealAlgebraicNumberDefiningPolynomial(self, v: Term) raises -> Term

Upstream Python signature:

Term.getRealAlgebraicNumberDefiningPolynomial(v: Term)

Note

Asserts isRealAlgebraicNumber().

Parameters

  • v: The variable over which to express the polynomial

Returns

The defining polynomial for the real algebraic number, expressed in terms of the given variable.

Binding: Generated from cvc5_term_get_real_algebraic_number_defining_polynomial.

Term.getRealAlgebraicNumberLowerBound

Mojo declaration:

def getRealAlgebraicNumberLowerBound(self) raises -> Term

Upstream Python signature:

Term.getRealAlgebraicNumberLowerBound()

Note

Asserts isRealAlgebraicNumber().

Returns

The lower bound for the value of the real algebraic number.

Binding: Generated from cvc5_term_get_real_algebraic_number_lower_bound.

Term.getRealAlgebraicNumberUpperBound

Mojo declaration:

def getRealAlgebraicNumberUpperBound(self) raises -> Term

Upstream Python signature:

Term.getRealAlgebraicNumberUpperBound()

Note

Asserts isRealAlgebraicNumber().

Returns

The upper bound for the value of the real algebraic number.

Binding: Generated from cvc5_term_get_real_algebraic_number_upper_bound.

Term.isSkolem

Mojo declaration:

def isSkolem(self) raises -> Bool

Upstream Python signature:

Term.isSkolem()

Warning

This function is experimental and may change in future versions.

Returns

True if the term is a skolem.

Binding: Generated from cvc5_term_is_skolem.

Term.getSkolemId

Mojo declaration:

def getSkolemId(self) raises -> SkolemId

Upstream Python signature:

Term.getSkolemId()

Get skolem identifier of this term.

Note

Asserts isSkolem().

Warning

This function is experimental and may change in future versions.

Returns

The skolem identifier of this term.

Binding: Generated from cvc5_term_get_skolem_id.

Term.getSkolemIndices

Mojo declaration:

def getSkolemIndices(self) raises -> List[Term]

Upstream Python signature:

Term.getSkolemIndices()

Note

Asserts isSkolem().

Warning

This function is experimental and may change in future versions.

Returns

The skolem indices of this term. This is list of terms that the skolem function is indexed by. For example, the array diff skolem SkolemId.ARRAY_DEQ_DIFF is indexed by two arrays.

Binding: Generated from cvc5_term_get_skolem_indices.

Term.isUninterpretedSortValue

Mojo declaration:

def isUninterpretedSortValue(self) raises -> Bool

Upstream Python signature:

Term.isUninterpretedSortValue()

Returns

True iff this term is a value from an uninterpreted sort.

Binding: Generated from cvc5_term_is_uninterpreted_sort_value.

Term.getUninterpretedSortValue

Mojo declaration:

def getUninterpretedSortValue(self) raises -> String

Upstream Python signature:

Term.getUninterpretedSortValue()

Note

Asserts isUninterpretedSortValue().

Returns

The representation of an uninterpreted value as a pair of its sort and its index.

Binding: Generated from cvc5_term_get_uninterpreted_sort_value.

Term.isTupleValue

Mojo declaration:

def isTupleValue(self) raises -> Bool

Upstream Python signature:

Term.isTupleValue()

Returns

True iff this term is a tuple value.

Binding: Generated from cvc5_term_is_tuple_value.

Term.isRoundingModeValue

Mojo declaration:

def isRoundingModeValue(self) raises -> Bool

Upstream Python signature:

Term.isRoundingModeValue()

Returns

True if the term is a floating-point rounding mode value.

Binding: Generated from cvc5_term_is_rm_value.

Term.getRoundingModeValue

Mojo declaration:

def getRoundingModeValue(self) raises -> RoundingMode

Upstream Python signature:

Term.getRoundingModeValue()

Note

Asserts isRoundingModeValue().

Returns

The floating-point rounding mode value held by the term.

Binding: Generated from cvc5_term_get_rm_value.

Term.getTupleValue

Mojo declaration:

def getTupleValue(self) raises -> List[Term]

Upstream Python signature:

Term.getTupleValue()

Note

Asserts isTupleValue().

Returns

The representation of a tuple value as a vector of terms.

Binding: Generated from cvc5_term_get_tuple_value.

Term.isRealValue

Mojo declaration:

def isRealValue(self) raises -> Bool

Upstream Python signature:

Term.isRealValue()

Note

A term of kind PI is not considered to be a real value.

Returns

True iff this term is a rational value.

Binding: Generated from cvc5_term_is_real_value.

Term.getRealValue

Mojo declaration:

def getRealValue(self) raises -> Rational

Upstream Python signature:

Term.getRealValue()

Note

Asserts isRealValue().

Returns

The representation of a rational value as a python Fraction.

Binding: Hand-written using cvc5_term_is_real64_value, cvc5_term_get_real64_value, cvc5_term_get_real_value. Use the native signed numerator/unsigned denominator getter when representable, with an exact decimal fallback..

Term.isBitVectorValue

Mojo declaration:

def isBitVectorValue(self) raises -> Bool

Upstream Python signature:

Term.isBitVectorValue()

Returns

True iff this term is a bit-vector value.

Binding: Generated from cvc5_term_is_bv_value.

Term.getBitVectorValue

Mojo declaration:

def getBitVectorValue(self, base: Int = 2) raises -> String
def getBitVectorValue(self, base: IntLiteral) raises -> String

Upstream Python signature:

Term.getBitVectorValue(base = 2)

Note

Asserts isBitVectorValue().

Supported bases are 2 (bit string), 10 (decimal string) or 16 (hexdecimal string).

Returns

The representation of a bit-vector value in string representation.

Binding: Generated from cvc5_term_get_bv_value.

Term.isFiniteFieldValue

Mojo declaration:

def isFiniteFieldValue(self) raises -> Bool

Upstream Python signature:

Term.isFiniteFieldValue()

Returns

True iff this term is a finite field value.

Binding: Generated from cvc5_term_is_ff_value.

Term.getFiniteFieldValue

Mojo declaration:

def getFiniteFieldValue(self) raises -> Integer

Upstream Python signature:

Term.getFiniteFieldValue()

Note

Asserts isFiniteFieldValue().

Note

Uses the integer representative of smallest absolute value.

Returns

The representation of a finite field value as an integer.

Binding: Generated from cvc5_term_get_ff_value.

1 Python method not mirrored
  • toPythonObj: Not mirrored: Converts to Python objects; Mojo has typed getters (getIntegerValue, getRealValue, ...).

Op

A cvc5 operator.

An operator is a term that represents certain operators, instantiated with its required parameters, e.g., a term of kind BITVECTOR_EXTRACT.

Wrapper class for Op.

10 of the 10 mirrored methods of Op are generated.

Method Summary Binding Mojo
__eq__ rule ✓
__ne__ rule ✓
__str__ auto ✓
__repr__ auto ✓
__hash__ rule ✓
getKind Returns the kind of this operator. auto ✓
isIndexed Returns true iff this operator is indexed. auto ✓
isNull Returns true iff this operator is a null term. rule ✓
getNumIndices Returns the number of indices of this op. auto ✓
__getitem__ Get the index at position i. override ✓

Op.__eq__

Mojo declaration:

def __eq__(self, other: Self) -> Bool

Upstream Python signature:

Op.__eq__(other: Op)

Binding: Generated by a rule from cvc5_op_is_equal.

Op.__ne__

Mojo declaration:

def __ne__(self, other: Self) -> Bool

Upstream Python signature:

Op.__ne__(other: Op)

Binding: Generated by a rule from cvc5_op_is_disequal.

Op.__str__

Mojo declaration:

def toString(self) -> String
def write_to(self, mut writer: Some[Writer])

Upstream Python signature:

Op.__str__()

Mojo uses the Writable protocol here: call String(value), repr(value), or print(value).

Binding: Generated from cvc5_op_to_string.

Op.__repr__

Mojo declaration:


Upstream Python signature:

Op.__repr__()

Mojo uses the Writable protocol here: call String(value), repr(value), or print(value).

Binding: Generated from cvc5_op_to_string.

Op.__hash__

Mojo declaration:

def __hash__[H: Hasher](self, mut hasher: H)

Upstream Python signature:

Op.__hash__()

Binding: Generated by a rule from cvc5_op_hash.

Op.getKind

Mojo declaration:

def getKind(self) raises -> Kind

Upstream Python signature:

Op.getKind()

Returns

The kind of this operator.

Binding: Generated from cvc5_op_get_kind.

Op.isIndexed

Mojo declaration:

def isIndexed(self) raises -> Bool

Upstream Python signature:

Op.isIndexed()

Returns

True iff this operator is indexed.

Binding: Generated from cvc5_op_is_indexed.

Op.isNull

Mojo declaration:

def isNull(self) -> Bool

Upstream Python signature:

Op.isNull()

Returns

True iff this operator is a null term.

Binding: Generated by a rule: a check for a NULL handle, which is how the C API represents a null object.

Op.getNumIndices

Mojo declaration:

def getNumIndices(self) raises -> Int

Upstream Python signature:

Op.getNumIndices()

Returns

The number of indices of this op.

Binding: Generated from cvc5_op_get_num_indices.

Op.__getitem__

Mojo declaration:

def __getitem__(self, i: Int) raises -> Term
def __getitem__(self, i: IntLiteral) raises -> Term

Upstream Python signature:

Op.__getitem__(i: int)

Get the index at position i.

Parameters

  • i: The position of the index to return.

Returns

The index at position i.

Binding: Bound to cvc5_op_get_index by bindgen/overrides.toml.

cvc5_mojo v1.4.1.1 for Mojo 1.2 and cvc5 1.4.1 · Apache License 2.0 with LLVM Exceptions · Source on GitHub