typed-racket/typed-racket-test
Andrew Kent 4bfb101677 use bits for base unions, make unions deterministic
This PR primarily changes how we represent Base types and unions of
Base types. Basically, Base types now contain a bits field, which
contains an exact-nonnegative-integer? with exactly one bit set to
1. This allows us to represent unions of Base types by simply OR-ing
together the various base bits. We store these unions in a new type
called a BaseUnion (which contains a field for numeric Base type bits
and a field for non-numeric Base type bits). We can perform set
operations on BaseUnion types rather quickly (using simple bitwise
arithmetic operations).

To make Union and BaseUnion work together nicely, the Union type now
has a field for non-Base types, and a field which contains any and all
Base types placed directly in the Union ( either as a Base if there is
only one, or as a BaseUnion if there are more than one).

Other changes present in this PR:

Base types are now "closed" -- i.e. Base types are only declared in
base-types.rkt and numeric-base-types.rkt with a special macro that
assigns them their respective bits. The constructor make-Base is no
longer provided for miscellaneous usages.

Some singleton Value types were moved to Base so all of our common
unions of basic types can fit into the new BaseUnion type (namely
Null, Void, One, Zero, and the booleans).

A new Val-able match expander lets us match on singleton types that
used to all be Value types, but, as described above, now some are Base
types.

Unions contain deterministically ordered, duplicate free lists (in
addition to sets for equality and constant time membership checks), so
iterating over Unions can be done deterministically (yay!) -- this
gets rid of some otherwise problematic behavior in areas like type
inference, where the order Unions are iterated over can actually
affect the results (i.e. if two valid type inferences are possible,
nondeterministic ordering means we can sometimes get one and sometimes
get another, which makes for particularly difficult to debug issues
and in general has no immediate solution (both substitutions are
valid, after all!))
2017-01-05 20:45:17 -05:00
..
fail be less eager about bottom propogation 2016-12-19 08:28:49 -05:00
gui/succeed Fix first-order check for TR's opaque object/c 2015-03-13 16:52:34 -04:00
optimizer Fix another test for new for expansion. 2016-12-14 15:19:42 -06:00
performance remove interning for most Reps in TR 2016-12-16 15:18:50 -05:00
succeed Add typed/images/compile-time.rkt (#476) 2017-01-04 17:02:42 -05:00
unit-tests use bits for base unions, make unions deterministic 2017-01-05 20:45:17 -05:00
xfail Adjust tests since opaque structs are no longer accepted by Any. 2016-07-09 21:22:08 -04:00
historical-counterexamples.rkt More drdr-found counterexamples. 2015-11-09 17:24:12 -06:00
info.rkt Add syntax for poly structs in require/typed 2016-07-21 12:00:08 -04:00
LICENSE.txt Remove extra directories. 2014-12-02 00:53:36 -05:00
main.rkt Fix accidentally-committed debugging code. 2016-06-24 09:15:28 -04:00
nightly-run.rkt Reduce directory nesting for tests. 2014-12-16 10:07:25 -05:00
places.rkt Rename open-place to place/context. 2015-07-28 16:15:08 -05:00
random-real.rkt Use math/flonum instead of unstable/flonum. 2015-08-27 14:14:51 -05:00
run.rkt Reorganize the TR testing files, and add progress output. 2015-12-29 16:43:25 -05:00
send-places.rkt Reduce directory nesting for tests. 2014-12-16 10:07:25 -05:00
test-docs-complete.rkt Reduce directory nesting for tests. 2014-12-16 10:07:25 -05:00
tr-random-testing.rkt Be more robust against one of {TR,R} erroring. 2015-11-10 16:39:18 -06:00
with-tr-contracts.rkt Fix more collection paths. 2014-12-18 09:30:17 -05:00