Changed the TR numeric tower to use the new flonums.

This commit is contained in:
Vincent St-Amour 2010-10-11 13:02:32 -04:00
parent f3ae9c73b0
commit a59a99c42d
10 changed files with 72 additions and 37 deletions

View File

@ -11,7 +11,7 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(: pi Float) (: pi Float)
(define pi (assert (atan 0 -1) inexact-real?)) (define pi (assert (atan 0 -1) flonum?))
;;; FFT -- This is an FFT benchmark written by Harry Barrow. ;;; FFT -- This is an FFT benchmark written by Harry Barrow.
;;; It tests a variety of floating point operations, ;;; It tests a variety of floating point operations,

View File

@ -12,7 +12,7 @@
(numlist : (Listof Float) '()) (numlist : (Listof Float) '())
(sum : Float 0.0)) (sum : Float 0.0))
(cond ((not (eof-object? line)) (cond ((not (eof-object? line))
(let ((num (assert (string->number line) inexact-real?))) (let ((num (assert (string->number line) flonum?)))
(loop (read-line) (cons num numlist) (+ num sum)))) (loop (read-line) (cons num numlist) (+ num sum))))
(else (else
(unless (null? numlist) (unless (null? numlist)

View File

@ -5,7 +5,7 @@
(for-template racket/flonum racket/fixnum racket/math racket/unsafe/ops racket/base) (for-template racket/flonum racket/fixnum racket/math racket/unsafe/ops racket/base)
(only-in (types abbrev) [-Number N] [-Boolean B] [-Symbol Sym] [-Real R] [-ExactPositiveInteger -Pos])) (only-in (types abbrev) [-Number N] [-Boolean B] [-Symbol Sym] [-Real R] [-ExactPositiveInteger -Pos]))
(define all-num-types (list -Pos -Nat -Integer -ExactRational -Flonum -Real N)) (define all-num-types (list -Pos -Nat -Integer -ExactRational -Flonum -InexactReal -Real N))
(define binop (define binop
(lambda (t [r t]) (lambda (t [r t])
@ -19,6 +19,7 @@
(-> -ExactRational -Integer) (-> -ExactRational -Integer)
(-> -NonnegativeFlonum -NonnegativeFlonum) (-> -NonnegativeFlonum -NonnegativeFlonum)
(-> -Flonum -Flonum) (-> -Flonum -Flonum)
(-> -InexactReal -InexactReal)
(-> -Real -Real))) (-> -Real -Real)))
(define (unop t) (-> t t)) (define (unop t) (-> t t))
@ -137,11 +138,12 @@
(-not-filter -Integer 0)))] (-not-filter -Integer 0)))]
[exact-integer? (make-pred-ty -Integer)] [exact-integer? (make-pred-ty -Integer)]
[real? (make-pred-ty -Real)] [real? (make-pred-ty -Real)]
[inexact-real? (make-pred-ty -Flonum)] [flonum? (make-pred-ty -Flonum)]
[inexact-real? (make-pred-ty -InexactReal)]
[complex? (make-pred-ty N)] [complex? (make-pred-ty N)]
[rational? (make-pred-ty -Real)] [rational? (make-pred-ty -Real)]
[exact? (asym-pred N B (-FS -top (-not-filter -ExactRational 0)))] [exact? (asym-pred N B (-FS -top (-not-filter -ExactRational 0)))]
[inexact? (asym-pred N B (-FS -top (-not-filter (Un -Flonum -InexactComplex) 0)))] [inexact? (asym-pred N B (-FS -top (-not-filter (Un -InexactReal -InexactComplex) 0)))]
[fixnum? (make-pred-ty -Fixnum)] [fixnum? (make-pred-ty -Fixnum)]
[positive? (cl->* (-> -Fixnum B : (-FS (-filter -PositiveFixnum 0) -top)) [positive? (cl->* (-> -Fixnum B : (-FS (-filter -PositiveFixnum 0) -top))
(-> -Integer B : (-FS (-filter -ExactPositiveInteger 0) -top)) (-> -Integer B : (-FS (-filter -ExactPositiveInteger 0) -top))
@ -228,6 +230,9 @@
(append (for/list ([t (list -Pos -Nat -Integer -ExactRational -NonnegativeFlonum -Flonum)]) (->* (list) t t)) (append (for/list ([t (list -Pos -Nat -Integer -ExactRational -NonnegativeFlonum -Flonum)]) (->* (list) t t))
(list (->* (list) (Un -Pos -NonnegativeFlonum) -NonnegativeFlonum)) (list (->* (list) (Un -Pos -NonnegativeFlonum) -NonnegativeFlonum))
(list (->* (list) (Un -Pos -Flonum) -Flonum)) (list (->* (list) (Un -Pos -Flonum) -Flonum))
(list (->* (list -Flonum) (Un -InexactReal -Flonum) -Flonum))
(list (->* (list -InexactReal -Flonum) (Un -InexactReal -Flonum) -Flonum))
(list (->* (list) -InexactReal -InexactReal))
(list (->* (list) -Real -Real)) (list (->* (list) -Real -Real))
(list (->* (list) (Un -InexactComplex -Flonum) -InexactComplex)) (list (->* (list) (Un -InexactComplex -Flonum) -InexactComplex))
(list (->* (list) N N))))] (list (->* (list) N N))))]
@ -240,6 +245,7 @@
(list (->* (list) (Un -Nat -NonnegativeFlonum) -NonnegativeFlonum)) (list (->* (list) (Un -Nat -NonnegativeFlonum) -NonnegativeFlonum))
(list (->* (list -Flonum) -Real -Flonum)) (list (->* (list -Flonum) -Real -Flonum))
(list (->* (list -Real -Flonum) -Real -Flonum)) (list (->* (list -Real -Flonum) -Real -Flonum))
(list (->* (list) -InexactReal -InexactReal))
(list (->* (list) -Real -Real)) (list (->* (list) -Real -Real))
(list (->* (list) (Un -Real -InexactComplex) -InexactComplex)) (list (->* (list) (Un -Real -InexactComplex) -InexactComplex))
(list (->* (list -InexactComplex) N -InexactComplex)) (list (->* (list -InexactComplex) N -InexactComplex))
@ -251,6 +257,7 @@
(->* (list t) t t)) (->* (list t) t t))
(list (->* (list -Flonum) -Real -Flonum)) (list (->* (list -Flonum) -Real -Flonum))
(list (->* (list -Real -Flonum) -Real -Flonum)) (list (->* (list -Real -Flonum) -Real -Flonum))
(list (->* (list -InexactReal) -InexactReal -InexactReal))
(list (->* (list -Real) -Real -Real)) (list (->* (list -Real) -Real -Real))
(list (->* (list) (Un -Real -InexactComplex) -InexactComplex)) (list (->* (list) (Un -Real -InexactComplex) -InexactComplex))
(list (->* (list -InexactComplex) N -InexactComplex)) (list (->* (list -InexactComplex) N -InexactComplex))
@ -262,6 +269,8 @@
(->* (list t) t t)) (->* (list t) t t))
;; only exact 0 as first argument can cause the result of a division involving inexacts to be exact ;; only exact 0 as first argument can cause the result of a division involving inexacts to be exact
(list (->* (list -Flonum) -Real -Flonum)) (list (->* (list -Flonum) -Real -Flonum))
(list (->* (list -InexactReal -Flonum) -InexactReal -Flonum))
(list (->* (list -InexactReal) -InexactReal -InexactReal))
(list (->* (list -Real) -Real -Real)) (list (->* (list -Real) -Real -Real))
(list (->* (list (Un -Flonum -InexactComplex)) (Un -Real -InexactComplex) -InexactComplex)) (list (->* (list (Un -Flonum -InexactComplex)) (Un -Real -InexactComplex) -InexactComplex))
(list (->* (list -InexactComplex) -InexactComplex -InexactComplex)) (list (->* (list -InexactComplex) -InexactComplex -InexactComplex))
@ -277,6 +286,7 @@
(->* (list -ExactRational) -ExactRational -ExactRational) (->* (list -ExactRational) -ExactRational -ExactRational)
(->* (list -NonnegativeFlonum) -Flonum -NonnegativeFlonum) (->* (list -NonnegativeFlonum) -Flonum -NonnegativeFlonum)
(->* (list -Flonum) -Flonum -Flonum) (->* (list -Flonum) -Flonum -Flonum)
(->* (list -InexactReal) -InexactReal -InexactReal)
(->* (list -Real) -Real -Real))] (->* (list -Real) -Real -Real))]
[min (cl->* (->* (list -PositiveFixnum) -PositiveFixnum -PositiveFixnum) [min (cl->* (->* (list -PositiveFixnum) -PositiveFixnum -PositiveFixnum)
(->* (list -NonnegativeFixnum) -NonnegativeFixnum -NonnegativeFixnum) (->* (list -NonnegativeFixnum) -NonnegativeFixnum -NonnegativeFixnum)
@ -289,6 +299,7 @@
(->* (list -ExactRational) -ExactRational -ExactRational) (->* (list -ExactRational) -ExactRational -ExactRational)
(->* (list -NonnegativeFlonum) -NonnegativeFlonum -NonnegativeFlonum) (->* (list -NonnegativeFlonum) -NonnegativeFlonum -NonnegativeFlonum)
(->* (list -Flonum) -Flonum -Flonum) (->* (list -Flonum) -Flonum -Flonum)
(->* (list -InexactReal) -InexactReal -InexactReal)
(->* (list -Real) -Real -Real))] (->* (list -Real) -Real -Real))]
@ -298,6 +309,7 @@
(-> -ExactRational -ExactRational) (-> -ExactRational -ExactRational)
(-> -NonnegativeFlonum -NonnegativeFlonum) (-> -NonnegativeFlonum -NonnegativeFlonum)
(-> -Flonum -Flonum) (-> -Flonum -Flonum)
(-> -InexactReal -InexactReal)
(-> -Real -Real) (-> -Real -Real)
(-> -InexactComplex -InexactComplex) (-> -InexactComplex -InexactComplex)
(-> N N))] (-> N N))]
@ -306,6 +318,7 @@
(-> -Integer -Integer) (-> -Integer -Integer)
(-> -ExactRational -ExactRational) (-> -ExactRational -ExactRational)
(-> -Flonum -Flonum) (-> -Flonum -Flonum)
(-> -InexactReal -InexactReal)
(-> -Real -Real) (-> -Real -Real)
(-> -InexactComplex -InexactComplex) (-> -InexactComplex -InexactComplex)
(-> N N))] (-> N N))]
@ -353,10 +366,13 @@
(-Pos . -> . -Pos) (-Pos . -> . -Pos)
(-Integer . -> . -Nat) (-Integer . -> . -Nat)
(-Flonum . -> . -NonnegativeFlonum) (-Flonum . -> . -NonnegativeFlonum)
(-InexactReal . -> . -InexactReal)
(-Real . -> . -Real))] (-Real . -> . -Real))]
;; exactness ;; exactness
[exact->inexact (cl->* [exact->inexact (cl->*
(-Flonum . -> . -Flonum) ; no conversion
(-InexactReal . -> . -InexactReal) ; no conversion
(-Real . -> . -Flonum) (-Real . -> . -Flonum)
(N . -> . -InexactComplex))] (N . -> . -InexactComplex))]
[inexact->exact (cl->* [inexact->exact (cl->*
@ -384,8 +400,9 @@
[denominator (cl->* (-ExactRational . -> . -Integer) [denominator (cl->* (-ExactRational . -> . -Integer)
(-Real . -> . -Real))] (-Real . -> . -Real))]
[rationalize (cl->* (-ExactRational -ExactRational . -> . -ExactRational) [rationalize (cl->* (-ExactRational -ExactRational . -> . -ExactRational)
(-Flonum . -> . -Flonum) (-Flonum -Flonum . -> . -Flonum)
(-Real -Real . -> . N))] (-InexactReal -InexactReal . -> . -InexactReal)
(-Real -Real . -> . -Real))]
[expt (cl->* (-Nat -Nat . -> . -Nat) [expt (cl->* (-Nat -Nat . -> . -Nat)
(-Integer -Nat . -> . -Integer) (-Integer -Nat . -> . -Integer)
(-Integer -Integer . -> . -ExactRational) (-Integer -Integer . -> . -ExactRational)
@ -402,15 +419,16 @@
(-InexactComplex . -> . -InexactComplex) (-InexactComplex . -> . -InexactComplex)
(N . -> . N))] (N . -> . N))]
[exp (cl->* (-Flonum . -> . -Flonum) [exp (cl->* (-Flonum . -> . -Flonum)
(-InexactReal . -> . -InexactReal)
(-Real . -> . -Real) (-Real . -> . -Real)
(-InexactComplex . -> . -InexactComplex) (-InexactComplex . -> . -InexactComplex)
(N . -> . N))] (N . -> . N))]
[cos (cl->* (-Flonum . -> . -Flonum) (-Real . -> . -Real) (-InexactComplex . -> . -InexactComplex) (N . -> . N))] [cos (cl->* (-Flonum . -> . -Flonum) (-InexactReal . -> . -InexactReal) (-Real . -> . -Real) (-InexactComplex . -> . -InexactComplex) (N . -> . N))]
[sin (cl->* (-Flonum . -> . -Flonum) (-Real . -> . -Real) (-InexactComplex . -> . -InexactComplex) (N . -> . N))] [sin (cl->* (-Flonum . -> . -Flonum) (-InexactReal . -> . -InexactReal) (-Real . -> . -Real) (-InexactComplex . -> . -InexactComplex) (N . -> . N))]
[tan (cl->* (-Flonum . -> . -Flonum) (-Real . -> . -Real) (-InexactComplex . -> . -InexactComplex) (N . -> . N))] [tan (cl->* (-Flonum . -> . -Flonum) (-InexactReal . -> . -InexactReal) (-Real . -> . -Real) (-InexactComplex . -> . -InexactComplex) (N . -> . N))]
[acos (cl->* (-Flonum . -> . -Flonum) (-Real . -> . -Real) (-InexactComplex . -> . -InexactComplex) (N . -> . N))] [acos (cl->* (-Flonum . -> . -Flonum) (-InexactReal . -> . -InexactReal) (-Real . -> . -Real) (-InexactComplex . -> . -InexactComplex) (N . -> . N))]
[asin (cl->* (-Flonum . -> . -Flonum) (-Real . -> . -Real) (-InexactComplex . -> . -InexactComplex) (N . -> . N))] [asin (cl->* (-Flonum . -> . -Flonum) (-InexactReal . -> . -InexactReal) (-Real . -> . -Real) (-InexactComplex . -> . -InexactComplex) (N . -> . N))]
[atan (cl->* (-Flonum . -> . -Flonum) (-Real . -> . -Real) (-InexactComplex . -> . -InexactComplex) (N . -> . N) (-Real -Real . -> . N))] [atan (cl->* (-Flonum . -> . -Flonum) (-InexactReal . -> . -InexactReal) (-Real . -> . -Real) (-InexactComplex . -> . -InexactComplex) (N . -> . N) (-Real -Real . -> . N))]
[gcd (cl->* (null -Fixnum . ->* . -Fixnum) (null -Integer . ->* . -Integer))] [gcd (cl->* (null -Fixnum . ->* . -Fixnum) (null -Integer . ->* . -Integer))]
[lcm (null -Integer . ->* . -Integer)] [lcm (null -Integer . ->* . -Integer)]
@ -422,6 +440,7 @@
(-> -Integer -Nat) (-> -Integer -Nat)
(-> -ExactRational -ExactRational) (-> -ExactRational -ExactRational)
(-> -Flonum -NonnegativeFlonum) (-> -Flonum -NonnegativeFlonum)
(-> -InexactReal -InexactReal)
(-> -Real -Real) (-> -Real -Real)
(-> -InexactComplex -InexactComplex) (-> -InexactComplex -InexactComplex)
(-> N N))] (-> N N))]

View File

@ -6,8 +6,10 @@
[Integer -Integer] [Integer -Integer]
[Real -Real] [Real -Real]
[Exact-Rational -ExactRational] [Exact-Rational -ExactRational]
[Float -Flonum] [Float -Flonum] ;; these 2 are the default, 64-bit floats, can be optimized
[Nonnegative-Float -NonnegativeFlonum] [Nonnegative-Float -NonnegativeFlonum] ;; associated test is: flonum?
[Inexact-Real -InexactReal] ;; any inexact real. could be 32- or 64-bit float
;; associated test is: inexact-real?
[Exact-Positive-Integer -ExactPositiveInteger] [Exact-Positive-Integer -ExactPositiveInteger]
[Exact-Nonnegative-Integer -ExactNonnegativeInteger] [Exact-Nonnegative-Integer -ExactNonnegativeInteger]
[Positive-Fixnum -PositiveFixnum] [Positive-Fixnum -PositiveFixnum]

View File

@ -39,18 +39,17 @@ For example, the following programs both typecheck:
(f 3.5)] (f 3.5)]
However, the second one uses more informative types: the However, the second one uses more informative types: the
@racket[Float] type includes only @racket[Float] type includes only 64-bit floating-point numbers
@tech[#:doc '(lib "scribblings/reference/reference.scrbl") #:key
"inexact numbers"]{inexact}
@tech[#:doc '(lib "scribblings/reference/reference.scrbl")]{real numbers}
whereas the whereas the
@racket[Real] type includes both exact and @racket[Real] type includes both exact and
@tech[#:doc '(lib "scribblings/reference/reference.scrbl") #:key @tech[#:doc '(lib "scribblings/reference/reference.scrbl") #:key
"inexact numbers"]{inexact} "inexact numbers"]{inexact}
@tech[#:doc '(lib "scribblings/reference/reference.scrbl")]{real numbers}. @tech[#:doc '(lib "scribblings/reference/reference.scrbl")]{real numbers}
and the @racket[Inexact-Real] type includes both 32- and 64-bit
floating-point numbers.
Typed Racket's optimizer can optimize the latter program to use Typed Racket's optimizer can optimize the latter program to use
@tech[#:doc '(lib "scribblings/reference/reference.scrbl") #:key @tech[#:doc '(lib "scribblings/reference/reference.scrbl") #:key
"inexact numbers"]{inexact} "inexact numbers"]{float}
-specific operations whereas it cannot do anything with the -specific operations whereas it cannot do anything with the
former program. former program.
@ -65,7 +64,9 @@ instance, the result of @racket[(* 2.0 0)] is @racket[0] which is not
a @racket[Float]. This can result in missed optimizations. To prevent a @racket[Float]. This can result in missed optimizations. To prevent
this, when mixing floating-point numbers and exact reals, coerce exact this, when mixing floating-point numbers and exact reals, coerce exact
reals to floating-point numbers using @racket[exact->inexact]. This is reals to floating-point numbers using @racket[exact->inexact]. This is
not necessary when using @racket[+] or @racket[-]. not necessary when using @racket[+] or @racket[-]. When mixing
floating-point numbers of different precisions, results use the
highest precision possible.
On a similar note, the @racket[Inexact-Complex] type is preferable to On a similar note, the @racket[Inexact-Complex] type is preferable to
the @racket[Complex] type for the same reason. Typed Racket can keep the @racket[Complex] type for the same reason. Typed Racket can keep

View File

@ -39,6 +39,7 @@ any expression of this type will not evaluate to a value.}
@defidform[Real] @defidform[Real]
@defidform[Float] @defidform[Float]
@defidform[Nonnegative-Float] @defidform[Nonnegative-Float]
@defidform[Inexact-Real]
@defidform[Exact-Rational] @defidform[Exact-Rational]
@defidform[Integer] @defidform[Integer]
@defidform[Natural] @defidform[Natural]
@ -51,6 +52,10 @@ any expression of this type will not evaluate to a value.}
)]{These types represent the hierarchy of @rtech{numbers} of Racket. )]{These types represent the hierarchy of @rtech{numbers} of Racket.
@racket[Integer] includes only @rtech{integers} that are @rtech{exact @racket[Integer] includes only @rtech{integers} that are @rtech{exact
numbers}, corresponding to the predicate @racket[exact-integer?]. numbers}, corresponding to the predicate @racket[exact-integer?].
@racket{Real} includes both exact and inexact reals.
An @racket{Inexact-Real} can be either 32- or 64-bit floating-point
numbers. @racket{Float} is restricted to 64-bit floats, which are the
default in Racket.
@ex[ @ex[
7 7

View File

@ -41,15 +41,15 @@
[(~var i (3d exact-nonnegative-integer?)) -ExactNonnegativeInteger] [(~var i (3d exact-nonnegative-integer?)) -ExactNonnegativeInteger]
[(~var i (3d exact-integer?)) -Integer] [(~var i (3d exact-integer?)) -Integer]
[(~var i (3d (conjoin number? exact? rational?))) -ExactRational] [(~var i (3d (conjoin number? exact? rational?))) -ExactRational]
[(~var i (3d (conjoin inexact-real? [(~var i (3d (conjoin flonum?
(lambda (x) (or (positive? x) (zero? x))) (lambda (x) (or (positive? x) (zero? x)))
(lambda (x) (not (eq? x -0.0)))))) (lambda (x) (not (eq? x -0.0))))))
-NonnegativeFlonum] -NonnegativeFlonum]
[(~var i (3d inexact-real?)) -Flonum] [(~var i (3d flonum?)) -Flonum]
[(~var i (3d real?)) -Real] [(~var i (3d real?)) -Real]
;; a complex number can't have an inexact imaginary part and an exact real part ;; a complex number can't have an inexact imaginary part and an exact real part
[(~var i (3d (conjoin number? (lambda (x) (and (inexact-real? (imag-part x)) [(~var i (3d (conjoin number? (lambda (x) (and (flonum? (imag-part x))
(inexact-real? (real-part x))))))) (flonum? (real-part x)))))))
-InexactComplex] -InexactComplex]
[(~var i (3d number?)) -Number] [(~var i (3d number?)) -Number]
[i:str -String] [i:str -String]

View File

@ -153,17 +153,20 @@
;; Numeric hierarchy ;; Numeric hierarchy
(define -Number (make-Base 'Number #'number?)) (define -Number (make-Base 'Number #'number?))
(define -InexactComplex (make-Base 'InexactComplex (define -InexactComplex (make-Base 'Inexact-Complex
#'(and/c number? #'(and/c number?
(lambda (x) (lambda (x)
(and (inexact-real? (imag-part x)) (and (flonum? (imag-part x))
(inexact-real? (real-part x))))))) (flonum? (real-part x)))))))
(define -Flonum (make-Base 'Flonum #'inexact-real?)) ;; default 64-bit floats
(define -Flonum (make-Base 'Flonum #'flonum?))
(define -NonnegativeFlonum (make-Base 'Nonnegative-Flonum (define -NonnegativeFlonum (make-Base 'Nonnegative-Flonum
#'(and/c inexact-real? #'(and/c flonum?
(or/c positive? zero?) (or/c positive? zero?)
(lambda (x) (not (eq? x -0.0)))))) (lambda (x) (not (eq? x -0.0))))))
;; could be 32- or 64-bit floats
(define -InexactReal (make-Base 'Inexact-Real #'inexact-real?))
(define -ExactRational (define -ExactRational
(make-Base 'Exact-Rational #'(and/c number? rational? exact?))) (make-Base 'Exact-Rational #'(and/c number? rational? exact?)))
@ -177,7 +180,7 @@
(make-Base 'Negative-Fixnum #'(and/c number? fixnum? negative?))) (make-Base 'Negative-Fixnum #'(and/c number? fixnum? negative?)))
(define -Zero (-val 0)) (define -Zero (-val 0))
(define -Real (*Un -Flonum -ExactRational)) (define -Real (*Un -InexactReal -ExactRational))
(define -Fixnum (*Un -PositiveFixnum -NegativeFixnum -Zero)) (define -Fixnum (*Un -PositiveFixnum -NegativeFixnum -Zero))
(define -NonnegativeFixnum (*Un -PositiveFixnum -Zero)) (define -NonnegativeFixnum (*Un -PositiveFixnum -Zero))
(define -ExactNonnegativeInteger (*Un -ExactPositiveInteger -Zero)) (define -ExactNonnegativeInteger (*Un -ExactPositiveInteger -Zero))

View File

@ -233,9 +233,10 @@
;; value types ;; value types
[((Value: v1) (Value: v2)) (=> unmatch) (if (equal? v1 v2) A0 (unmatch))] [((Value: v1) (Value: v2)) (=> unmatch) (if (equal? v1 v2) A0 (unmatch))]
;; now we encode the numeric hierarchy - bletch ;; now we encode the numeric hierarchy - bletch
[((Base: 'Integer _) (== -Real =t)) A0]
[((Base: 'Integer _) (Base: 'Number _)) A0] [((Base: 'Integer _) (Base: 'Number _)) A0]
[((Base: 'Flonum _) (Base: 'Inexact-Real _)) A0]
[((Base: 'Flonum _) (== -Real =t)) A0] [((Base: 'Flonum _) (== -Real =t)) A0]
[((Base: 'Integer _) (== -Real =t)) A0]
[((Base: 'Flonum _) (Base: 'Number _)) A0] [((Base: 'Flonum _) (Base: 'Number _)) A0]
[((Base: 'Exact-Rational _) (Base: 'Number _)) A0] [((Base: 'Exact-Rational _) (Base: 'Number _)) A0]
[((Base: 'Integer _) (Base: 'Exact-Rational _)) A0] [((Base: 'Integer _) (Base: 'Exact-Rational _)) A0]
@ -263,9 +264,13 @@
[((== -Fixnum =t) (Base: 'Integer _)) A0] [((== -Fixnum =t) (Base: 'Integer _)) A0]
[((Base: 'Nonnegative-Flonum _) (Base: 'Flonum _)) A0] [((Base: 'Nonnegative-Flonum _) (Base: 'Flonum _)) A0]
[((Base: 'Nonnegative-Flonum _) (Base: 'Inexact-Real _)) A0]
[((Base: 'Nonnegative-Flonum _) (Base: 'Number _)) A0] [((Base: 'Nonnegative-Flonum _) (Base: 'Number _)) A0]
[((Base: 'InexactComplex _) (Base: 'Number _)) A0] [((Base: 'Inexact-Real _) (== -Real =t)) A0]
[((Base: 'Inexact-Real _) (Base: 'Number _)) A0]
[((Base: 'Inexact-Complex _) (Base: 'Number _)) A0]
;; values are subtypes of their "type" ;; values are subtypes of their "type"
@ -273,7 +278,7 @@
[((Value: (and n (? number?) (? exact?) (? rational?))) (Base: 'Exact-Rational _)) A0] [((Value: (and n (? number?) (? exact?) (? rational?))) (Base: 'Exact-Rational _)) A0]
[((Value: (? exact-nonnegative-integer? n)) (== -Nat =t)) A0] [((Value: (? exact-nonnegative-integer? n)) (== -Nat =t)) A0]
[((Value: (? exact-positive-integer? n)) (Base: 'Exact-Positive-Integer _)) A0] [((Value: (? exact-positive-integer? n)) (Base: 'Exact-Positive-Integer _)) A0]
[((Value: (? inexact-real? n)) (Base: 'Flonum _)) A0] [((Value: (? flonum? n)) (Base: 'Flonum _)) A0]
[((Value: (? real? n)) (== -Real =t)) A0] [((Value: (? real? n)) (== -Real =t)) A0]
[((Value: (? number? n)) (Base: 'Number _)) A0] [((Value: (? number? n)) (Base: 'Number _)) A0]