Handbook
Glossary
initialize-partitions ( transition-table -- partitions )
Vocabulary
regexp
.
minimize
Inputs
transition-table
an
object
Outputs
partitions
an
object
Definition
USING:
accessors
arrays
assocs
hash-sets
kernel
math
sequences
sets
sorting
;
IN:
regexp.minimize
::
initialize-partitions
( transition-table -- partitions )
transition-table
transitions>>
keys
sort
:>
states states
length
2/
sq
<hash-set>
:>
out states
[|
s1 i1 |
states
[|
s2 |
s1 s2 transition-table
initially-same?
[
s1 s2
2array
out
adjoin
]
when
]
i1
each-from
]
each-index
out
;