3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-27 02:45:51 +00:00

enable binary string access to unsigned numerals over API #4568

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2020-07-07 18:17:54 -07:00
parent 2d358a9a50
commit 4a8533e41f
4 changed files with 41 additions and 1 deletions

View file

@ -2792,6 +2792,14 @@ class IntNumRef(ArithRef):
"""
return Z3_get_numeral_string(self.ctx_ref(), self.as_ast())
def as_binary_string(self):
"""Return a Z3 integer numeral as a Python binary string.
>>> v = IntVal(10)
>>> v.as_string()
'1010'
"""
return Z3_get_numeral_binary_string(self.ctx_ref(), self.as_ast())
class RatNumRef(ArithRef):
"""Rational values."""