If I issue:
(set-option :pp-decimal true)
(set-option :pp-decimal-precision 10)
Does Z3 do any rounding after the 10th digit of the real number? Or does it just chop the remaining digits without any rounding?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In Z3 4.0, an algebraic number
alphais represented using a univariate polynomialpand two binary rationals:lowerandupper. A binary rational is a rational number of the forma/2^kwhereais an integer andka natural number. We have thatalphais the only root ofpin the interval(lower, upper). When the optionsare provided. First, I squeeze/refine the interval
(lower, upper)untilupper - lower < 1/10^N. Then, I peek the upper bound (which is a binary rational) and display it in decimal by chopping after the Nth digit. To be more precise, the refinement is actually performed untilupper - lower < 1/16^N.I realize this is not an ideal solution, but it is good enough for most purposes.