From 48555c36033eca19c0b2df4524cd1824e6c5660f Mon Sep 17 00:00:00 2001 From: gus-massa Date: Sun, 7 Jan 2024 23:59:49 -0300 Subject: [PATCH] Update more tests in cptypes.ms --- mats/cptypes.ms | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/mats/cptypes.ms b/mats/cptypes.ms index 2c2c1363c..453c2cfff 100644 --- a/mats/cptypes.ms +++ b/mats/cptypes.ms @@ -878,16 +878,45 @@ (add1 x))) '(lambda (x) (when (flonum? x) (#3%fl+ x 1.0)))) + (cptypes-equivalent-expansion? + '(lambda (x) (when (fixnum? x) + (let ([y (sub1 x)]) + (and (integer? y) (exact? y))))) + '(lambda (x) (when (fixnum? x) + (let ([y (sub1 x)]) + #t)))) + (cptypes-equivalent-expansion? + '(lambda (x) (when (real? x) + (real? (sub1 x)))) + '(lambda (x) (when (real? x) + #t))) + (cptypes-equivalent-expansion? + '(lambda (x) (when (flonum? x) + (flonum? (sub1 x)))) + '(lambda (x) (when (flonum? x) + #t))) (cptypes-equivalent-expansion? '(lambda (x) (when (flonum? x) (sub1 x))) '(lambda (x) (when (flonum? x) (#3%fl- x 1.0)))) + (cptypes-equivalent-expansion? + '(lambda (x) (when (fixnum? x) + (let ([y (abs x)]) + (and (integer? y) (exact? y))))) + '(lambda (x) (when (fixnum? x) + (let ([y (abs x)]) + #t)))) (cptypes-equivalent-expansion? '(lambda (x) (when (real? x) (real? (abs x)))) '(lambda (x) (when (real? x) #t))) + (cptypes-equivalent-expansion? + '(lambda (x) (when (flonum? x) + (flonum? (abs x)))) + '(lambda (x) (when (flonum? x) + #t))) ) (mat cptypes-rest-argument