[racket-dev] math collection [was: Hyperbolic functions]

From: Vincent St-Amour (stamourv at ccs.neu.edu)
Date: Thu Jun 28 16:45:43 EDT 2012

At Thu, 28 Jun 2012 14:24:04 -0600,
Neil Toronto wrote:
> Also, I just had an idea. Vincent, how hard would it be to use something 
> like the current randomized testing to *search* for a more precise type? 
> I'm thinking of an algorithm that iteratively 1) makes a type like (Real 
> -> Real) more precise (e.g. (case -> (Float -> Float) (Real -> Real))), 
> then 2) tests it on random inputs. It would backtrack if testing finds 
> preservation counterexamples, and repeat until it can't refine the type 
> anymore.

Using random generation to find potential additions to existing types
(then adding them manually) sounds interesting.

I'm less comfortable with the idea of using random generation to
generate types from scratch.  A lot of numeric types have symmetries
and/or patterns (e.g. behavior on `Byte', `Index' and
`Nonnegative-Fixnum' usually follows the same patterns) that depend a
lot on the specific operation. Random generation would likely generate
irregular types, which would lead to inconsistent behavior across
"similar" types.


Posted on the dev mailing list.