|
92 | 92 |
|
93 | 93 | [`(< (* ,a ,a) 0) '(FALSE)] |
94 | 94 | [`(< (sqrt ,a) 0) '(FALSE)] |
| 95 | + [`(< (fabs ,a) 0) '(FALSE)] |
95 | 96 | [`(,(or '< '==) (cosh ,a) ,(? (conjoin number? (curryr < 1)))) '(FALSE)] |
96 | 97 | [`(,(or '< '==) (exp ,a) ,(? (conjoin number? (curryr <= 0)))) '(FALSE)] |
97 | 98 | [`(,(or '< '==) (* ,a ,a) ,(? (conjoin number? (curryr < 0)))) '(FALSE)] |
|
159 | 160 | xs |
160 | 161 | (simplify-conditions simple1))) |
161 | 162 |
|
| 163 | +;; The prover must prove: rhs-bad => lhs-bad |
| 164 | +;; IOW we can weaken the RHS or strengthen the LHS |
| 165 | + |
162 | 166 | (define soundness-proofs |
163 | 167 | '((pow-plus (implies (< b -1) (< b 0))) |
164 | 168 | (pow-sqr (implies (even-denominator? (* 2 b)) (even-denominator? b))) |
165 | 169 | (hang-0p-tan (implies (== (cos (/ a 2)) 0) (== (cos a) -1))) |
166 | | - (hang-0p-tan-rev (implies (== (cos (/ a 2)) 0) (== (cos a) -1))) |
167 | | - (hang-0m-tan (implies (== (cos (/ a 2)) 0) (== (cos a) -1))) |
168 | | - (hang-0m-tan-rev (implies (== (cos (/ a 2)) 0) (== (cos a) -1))) |
| 170 | + (hang-0p-tan-rev (implies (== (cos a) -1) (== (cos (/ a 2)) 0))) |
| 171 | + (hang-0m-tan (implies (== (cos (/ (neg a) 2)) 0) (== (cos a) -1))) |
| 172 | + (hang-0m-tan-rev (implies (== (cos a) -1) (== (cos (/ (neg a) 2)) 0))) |
169 | 173 | (tanh-sum (implies (== (* (tanh x) (tanh y)) -1) (FALSE))) |
170 | 174 | (tanh-def-a (implies (== (+ (exp x) (exp (neg x))) 0) (FALSE))) |
171 | | - (acosh-def (implies (< x 1) (or (< x -1) (== x -1) (< (fabs x) 1)))) |
| 175 | + (acosh-def (implies (< x -1) (< x 1)) (implies (== x -1) (< x 1)) (implies (< (fabs x) 1) (< x 1))) |
172 | 176 | (acosh-def-rev (implies (< x 1) (or (< x -1) (== x -1) (< (fabs x) 1)))) |
173 | 177 | (sqrt-undiv (implies (< (/ x y) 0) (or (< x 0) (< y 0)))) |
174 | 178 | (sqrt-unprod (implies (< (* x y) 0) (or (< x 0) (< y 0)))) |
| 179 | + (sqrt-pow2 (implies (and (< x 0) _) (< x 0))) |
175 | 180 | (tan-sum-rev (implies (== (cos (+ x y)) 0) (== (* (tan x) (tan y)) 1))) |
176 | 181 | (sum-log (implies (< (* x y) 0) (or (< x 0) (< y 0)))) |
177 | 182 | (diff-log (implies (< (/ x y) 0) (or (< x 0) (< y 0)))) |
178 | 183 | (exp-to-pow (implies (and a b) a)) |
179 | | - (sinh-acosh (implies (< (fabs x) 1) (< x 1))) |
180 | 184 | (acosh-2-rev (implies (< (fabs x) 1) (< x 1))) |
181 | 185 | (tanh-acosh (implies (< (fabs x) 1) (< x 1)) (implies (== x 0) (< x 1))) |
| 186 | + (sinh-acosh (implies (< (fabs x) 1) (< x 1))) |
182 | 187 | (hang-p0-tan (implies (== (cos (/ a 2)) 0) (== (sin a) 0))) |
183 | 188 | (hang-m0-tan (implies (== (cos (/ a 2)) 0) (== (sin a) 0))) |
184 | | - (sqrt-pow2 (implies (and a b) a)) |
185 | 189 | (pow-div (implies (< (- b c) 0) (or (< b 0) (> c 0))) |
186 | 190 | (implies (even-denominator? (- b c)) (or (even-denominator? b) (even-denominator? c)))) |
187 | 191 | (pow-prod-up (implies (< (+ b c) 0) (or (< b 0) (< c 0))) |
|
196 | 200 | (simplify-conditions (map (curryr rewrite-all a b) terms)))) |
197 | 201 |
|
198 | 202 | (define (rewrite-unsound? lhs rhs [proof '()]) |
199 | | - (define lhs-bad (execute-proof proof (undefined-conditions lhs))) |
| 203 | + (define lhs-bad (simplify-conditions (undefined-conditions lhs))) |
200 | 204 | (define rhs-bad (execute-proof proof (undefined-conditions rhs))) |
201 | 205 | (define extra (set-remove (set-subtract rhs-bad lhs-bad) '(FALSE))) |
202 | 206 | (if (empty? extra) |
|
0 commit comments