From a6d83eb2c7c0de2800c2d7f76e6a961ea83acd51 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Sun, 18 Nov 2018 03:33:15 +0000 Subject: [PATCH] Remove buggy `optimization' of (<= x y) into (not (> x y)). --- src/sf/usiexp.scm | 15 --------------- tests/runtime/test-arith.scm | 8 ++++---- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/src/sf/usiexp.scm b/src/sf/usiexp.scm index b9f3fe10d..034ec2ed5 100644 --- a/src/sf/usiexp.scm +++ b/src/sf/usiexp.scm @@ -111,14 +111,6 @@ USA. (make-combination expr block binary-predicate operands))) #f))) -(define (pairwise-test-inverse inverse-expansion) - (lambda (expr operands block) - (let ((inverse (inverse-expansion expr operands block))) - (if inverse - (make-combination expr block (ucode-primitive not) - (list inverse)) - #f)))) - (define =-expansion (pairwise-test (ucode-primitive &=) (ucode-primitive zero?) @@ -133,9 +125,6 @@ USA. (pairwise-test (ucode-primitive &>) (ucode-primitive negative?) (ucode-primitive positive?))) - -(define <=-expansion (pairwise-test-inverse >-expansion)) -(define >=-expansion (pairwise-test-inverse <-expansion)) ;;;; Fixnum Operations @@ -703,10 +692,8 @@ USA. / 1+ < - <= = > - >= apply caaaar caaadr @@ -787,10 +774,8 @@ USA. /-expansion 1+-expansion <-expansion - <=-expansion =-expansion >-expansion - >=-expansion apply*-expansion caaaar-expansion caaadr-expansion diff --git a/tests/runtime/test-arith.scm b/tests/runtime/test-arith.scm index fdb949b1f..c4198e577 100644 --- a/tests/runtime/test-arith.scm +++ b/tests/runtime/test-arith.scm @@ -136,17 +136,17 @@ USA. (assert-false (= x (flo:nan.0))) (assert-false (< x (flo:nan.0))) (assert-false ((id >=) x (flo:nan.0))) - (expect-failure (lambda () (assert-false (>= x (flo:nan.0))))) + (assert-false (>= x (flo:nan.0))) (assert-false (> x (flo:nan.0))) (assert-false ((id <=) x (flo:nan.0))) - (expect-failure (lambda () (assert-false (<= x (flo:nan.0))))) + (assert-false (<= x (flo:nan.0))) (assert-false (= (flo:nan.0) x)) (assert-false (< (flo:nan.0) x)) (assert-false ((id >=) (flo:nan.0) x)) - (expect-failure (lambda () (assert-false (>= (flo:nan.0) x)))) + (assert-false (>= (flo:nan.0) x)) (assert-false (> (flo:nan.0) x)) (assert-false ((id <=) (flo:nan.0) x)) - (expect-failure (lambda () (assert-false (<= (flo:nan.0) x))))))) + (assert-false (<= (flo:nan.0) x))))) (define-enumerated-test 'inf*0-exact (vector (list 0 (flo:+inf.0)) -- 2.25.1