From 424658f6abe1b889236e97c807e8e4bc2e8ac587 Mon Sep 17 00:00:00 2001 From: Eric Dobson Date: Thu, 9 Apr 2015 23:23:41 -0700 Subject: [PATCH] Tighten fxmin and fxmax. Replace Zero case with all NonNegative or NonPositive values. --- .../typed-racket/base-env/base-env-numeric.rkt | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/typed-racket-lib/typed-racket/base-env/base-env-numeric.rkt b/typed-racket-lib/typed-racket/base-env/base-env-numeric.rkt index 478d3b00..731243e5 100644 --- a/typed-racket-lib/typed-racket/base-env/base-env-numeric.rkt +++ b/typed-racket-lib/typed-racket/base-env/base-env-numeric.rkt @@ -318,9 +318,11 @@ (define fxmin-type (lambda () (fx-from-cases - (binop -Zero) - (binop -One) - (commutative-binop -Zero (Un -Zero -One) -Zero) + (-> -Nat -NonPosInt -NonPosFixnum : -true-filter : (-arg-path 1)) + (-> -NonPosInt -Nat -NonPosFixnum : -true-filter : (-arg-path 0)) + (-> -Zero -Int -NonPosFixnum) + (-> -Int -Zero -NonPosFixnum) + (commutative-binop -PosByte -PosInt -PosByte) (commutative-binop -Byte -Nat -Byte) (commutative-binop -PosIndex -PosInt -PosIndex) @@ -333,8 +335,11 @@ (define fxmax-type (lambda () (fx-from-cases - (binop -Zero) - (commutative-binop -One (Un -Zero -One) -One) + (-> -NonPosInt -Nat -NonNegFixnum : -true-filter : (-arg-path 1)) + (-> -Nat -NonPosInt -NonNegFixnum : -true-filter : (-arg-path 0)) + (-> -Zero -Int -NonNegFixnum) + (-> -Int -Zero -NonNegFixnum) + (commutative-binop -PosByte -Byte -PosByte) (binop -Byte) (commutative-binop -PosIndex -Index -PosIndex)