 
 : partition>class ( parts -- class )
     [ out>> [ <not-class> ] map ]
-    [ in>> <and-class> ] bi
-    prefix <and-class> ;
+    [ in>> <and-class> ] bi prefix <and-class> ;
 
 : singleton-partition ( integer non-integers -- {class,partition} )
     dupd

    2array ;

: add-out ( seq partition -- partition' )
    [ out>> append ] [ in>> ] bi swap parts boa ;

: intersection ( seq -- elts )
    [ f ] [ unclip [ intersect ] reduce ] if-empty ;

: meaningful-integers ( partition table -- integers )


: add-integers ( partitions classes integers -- partitions )
    class-integers '[
        [ _ meaningful-integers ] [ ] bi add-out
    ] map ;

:: class-partitions ( classes -- assoc )
    classes [ integer? ] partition :> ( integers classes )

    classes powerset-partition classes integers add-integers
    [ [ partition>class ] [ ] bi 2array ] map sift-keys
    integers [ classes singleton-partition ] map append ;

: new-transitions ( transitions -- assoc ) ! assoc is class, partition
    values [ keys ] gather [ tagged-epsilon? ] reject class-partitions ;

: get-transitions ( partition state-transitions -- next-states )
    [ in>> ] dip '[ _ at ] gather sift ;

: disambiguate ( nfa -- nfa )
    expand-ors [
