IntNumeral constructor

IntNumeral(
  1. BigInt value
)

Implementation

factory IntNumeral(BigInt value) {
  if (value.isValidInt) {
    final ast = _mathContext._z3.mk_int64(
      value.toInt(),
      _mathContext._intSort,
    );
    return _mathContext._getAST(ast) as IntNumeral;
  }
  final valuePtr = '$value'.toNativeUtf8();
  try {
    final ast = _mathContext._z3.mk_numeral(
      valuePtr.cast(),
      _mathContext._intSort,
    );
    return _mathContext._getAST(ast) as IntNumeral;
  } finally {
    malloc.free(valuePtr);
  }
}