mirror of
https://github.com/Z3Prover/z3
synced 2025-06-13 09:26:15 +00:00
fix regression for z3num
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
4ec4abd7e3
commit
60783e5696
1 changed files with 7 additions and 1 deletions
|
@ -2394,7 +2394,7 @@ def is_int_value(a):
|
||||||
>>> is_int_value(RealVal(1))
|
>>> is_int_value(RealVal(1))
|
||||||
False
|
False
|
||||||
"""
|
"""
|
||||||
return isinstance(a, IntNumRef)
|
return is_arith(a) and a.is_int() and _is_numeral(a.ctx, a.as_ast())
|
||||||
|
|
||||||
def is_rational_value(a):
|
def is_rational_value(a):
|
||||||
"""Return `True` if `a` is rational value of sort Real.
|
"""Return `True` if `a` is rational value of sort Real.
|
||||||
|
@ -2662,6 +2662,12 @@ class RatNumRef(ArithRef):
|
||||||
return self.denominator().as_long()
|
return self.denominator().as_long()
|
||||||
|
|
||||||
def is_int(self):
|
def is_int(self):
|
||||||
|
return False
|
||||||
|
|
||||||
|
def is_real(self):
|
||||||
|
return True
|
||||||
|
|
||||||
|
def is_int_value(self):
|
||||||
return self.denominator().is_int() and self.denominator_as_long() == 1
|
return self.denominator().is_int() and self.denominator_as_long() == 1
|
||||||
|
|
||||||
def as_long(self):
|
def as_long(self):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue