Skip to content

Commit cadae15

Browse files
committed
Add issue 10175 regressions
1 parent 1acda72 commit cadae15

4 files changed

Lines changed: 146 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
unknown
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
; The existing round() contract uses an ebits+2 signed exponent. For FP(2,8),
2+
; exact normalized division exponents can exceed that workspace. Reject the
3+
; symbolic conversion instead of silently wrapping the exponent.
4+
(set-logic QF_FP)
5+
(declare-fun x () (_ FloatingPoint 2 8))
6+
(declare-fun y () (_ FloatingPoint 2 8))
7+
(assert (fp.eq (fp.div RNE x y) x))
8+
(check-sat)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
unsat
2+
unsat
3+
unsat
4+
unsat
5+
unsat
6+
unsat
7+
unsat
8+
unsat
9+
unsat
10+
unsat
11+
unsat
12+
unsat
13+
unsat
14+
sat

regressions/smt2/10175.smt2

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
; Regression for Z3 issue #10175.
2+
(set-logic QF_FP)
3+
; pre-wrap control: exact quotient is 2.0.
4+
(push)
5+
(declare-fun d_2_4 () (_ FloatingPoint 2 4))
6+
(assert (fp.eq d_2_4 (fp #b0 #b00 #b001)))
7+
(assert (not (fp.eq
8+
(fp.div RTZ (fp #b0 #b00 #b010) d_2_4)
9+
(fp #b0 #b10 #b000))))
10+
(check-sat)
11+
(pop)
12+
; first wrapped count: exact quotient is 2.0.
13+
(push)
14+
(declare-fun d_2_5 () (_ FloatingPoint 2 5))
15+
(assert (fp.eq d_2_5 (fp #b0 #b00 #b0001)))
16+
(assert (not (fp.eq
17+
(fp.div RTZ (fp #b0 #b00 #b0010) d_2_5)
18+
(fp #b0 #b10 #b0000))))
19+
(check-sat)
20+
(pop)
21+
; reported format: exact quotient is 2.0.
22+
(push)
23+
(declare-fun d_2_6 () (_ FloatingPoint 2 6))
24+
(assert (fp.eq d_2_6 (fp #b0 #b00 #b00010)))
25+
(assert (not (fp.eq
26+
(fp.div RTZ (fp #b0 #b00 #b00100) d_2_6)
27+
(fp #b0 #b10 #b00000))))
28+
(check-sat)
29+
(pop)
30+
; largest format covered by ebits+2 exponent workspace: exact quotient is 2.0.
31+
(push)
32+
(declare-fun d_2_7 () (_ FloatingPoint 2 7))
33+
(assert (fp.eq d_2_7 (fp #b0 #b00 #b000100)))
34+
(assert (not (fp.eq
35+
(fp.div RTZ (fp #b0 #b00 #b001000) d_2_7)
36+
(fp #b0 #b10 #b000000))))
37+
(check-sat)
38+
(pop)
39+
; FP(2,7) upper exponent endpoint: max finite / min subnormal = 254.
40+
(push)
41+
(declare-fun d_2_7_upper () (_ FloatingPoint 2 7))
42+
(assert (fp.eq d_2_7_upper (fp #b0 #b00 #b000001)))
43+
(assert (not (fp.eq
44+
(fp.div RTZ (fp #b0 #b10 #b111111) d_2_7_upper)
45+
(fp #b0 #b10 #b111111))))
46+
(check-sat)
47+
(pop)
48+
; FP(2,7) lower exponent endpoint: min subnormal / max finite = 1/254.
49+
(push)
50+
(declare-fun d_2_7_lower () (_ FloatingPoint 2 7))
51+
(assert (fp.eq d_2_7_lower (fp #b0 #b10 #b111111)))
52+
(assert (not (fp.eq
53+
(fp.div RTP (fp #b0 #b00 #b000001) d_2_7_lower)
54+
(fp #b0 #b00 #b000001))))
55+
(check-sat)
56+
(pop)
57+
; pre-wrap control: exact quotient is 2.0.
58+
(push)
59+
(declare-fun d_3_8 () (_ FloatingPoint 3 8))
60+
(assert (fp.eq d_3_8 (fp #b0 #b000 #b0000001)))
61+
(assert (not (fp.eq
62+
(fp.div RTZ (fp #b0 #b000 #b0000010) d_3_8)
63+
(fp #b0 #b100 #b0000000))))
64+
(check-sat)
65+
(pop)
66+
; first wrapped count: exact quotient is 2.0.
67+
(push)
68+
(declare-fun d_3_9 () (_ FloatingPoint 3 9))
69+
(assert (fp.eq d_3_9 (fp #b0 #b000 #b00000001)))
70+
(assert (not (fp.eq
71+
(fp.div RTZ (fp #b0 #b000 #b00000010) d_3_9)
72+
(fp #b0 #b100 #b00000000))))
73+
(check-sat)
74+
(pop)
75+
; largest covered format: exact quotient is 2.0.
76+
(push)
77+
(declare-fun d_3_11 () (_ FloatingPoint 3 11))
78+
(assert (fp.eq d_3_11 (fp #b0 #b000 #b0000000100)))
79+
(assert (not (fp.eq
80+
(fp.div RTZ (fp #b0 #b000 #b0000001000) d_3_11)
81+
(fp #b0 #b100 #b0000000000))))
82+
(check-sat)
83+
(pop)
84+
; pre-wrap control: exact quotient is 2.0.
85+
(push)
86+
(declare-fun d_4_16 () (_ FloatingPoint 4 16))
87+
(assert (fp.eq d_4_16 (fp #b0 #b0000 #b000000000000001)))
88+
(assert (not (fp.eq
89+
(fp.div RTZ (fp #b0 #b0000 #b000000000000010) d_4_16)
90+
(fp #b0 #b1000 #b000000000000000))))
91+
(check-sat)
92+
(pop)
93+
; first wrapped count: exact quotient is 2.0.
94+
(push)
95+
(declare-fun d_4_17 () (_ FloatingPoint 4 17))
96+
(assert (fp.eq d_4_17 (fp #b0 #b0000 #b0000000000000001)))
97+
(assert (not (fp.eq
98+
(fp.div RTZ (fp #b0 #b0000 #b0000000000000010) d_4_17)
99+
(fp #b0 #b1000 #b0000000000000000))))
100+
(check-sat)
101+
(pop)
102+
; largest covered format: exact quotient is 2.0.
103+
(push)
104+
(declare-fun d_4_19 () (_ FloatingPoint 4 19))
105+
(assert (fp.eq d_4_19 (fp #b0 #b0000 #b000000000000000100)))
106+
(assert (not (fp.eq
107+
(fp.div RTZ (fp #b0 #b0000 #b000000000000001000) d_4_19)
108+
(fp #b0 #b1000 #b000000000000000000))))
109+
(check-sat)
110+
(pop)
111+
; Reported negative-overflow case: -3.25 / 1/16 = -52 in FP(2,6).
112+
(push)
113+
(declare-fun d_rtz () (_ FloatingPoint 2 6))
114+
(assert (fp.eq d_rtz (fp #b0 #b00 #b00010)))
115+
(assert (fp.eq (fp.div RTZ (fp #b1 #b10 #b10100) d_rtz) (_ -oo 2 6)))
116+
(check-sat)
117+
(pop)
118+
(push)
119+
(declare-fun d_rtn () (_ FloatingPoint 2 6))
120+
(assert (fp.eq d_rtn (fp #b0 #b00 #b00010)))
121+
(assert (fp.eq (fp.div RTN (fp #b1 #b10 #b10100) d_rtn) (_ -oo 2 6)))
122+
(check-sat)
123+
(pop)

0 commit comments

Comments
 (0)