|
|
@ -239,19 +239,19 @@
|
|
|
|
(cond
|
|
|
|
(cond
|
|
|
|
((and (null? old-states) (null? new-states))
|
|
|
|
((and (null? old-states) (null? new-states))
|
|
|
|
(make-dfa (get-state-number) (state-index start)
|
|
|
|
(make-dfa (get-state-number) (state-index start)
|
|
|
|
(mergesort (filter (lambda (x) (cdr x))
|
|
|
|
(sort (filter (lambda (x) (cdr x))
|
|
|
|
(map (lambda (state)
|
|
|
|
(map (lambda (state)
|
|
|
|
(cons (state-index state) (get-final (state-spec state))))
|
|
|
|
(cons (state-index state) (get-final (state-spec state))))
|
|
|
|
all-states))
|
|
|
|
all-states))
|
|
|
|
(lambda (a b) (< (car a) (car b))))
|
|
|
|
(lambda (a b) (< (car a) (car b))))
|
|
|
|
(mergesort (hash-table-map transitions
|
|
|
|
(sort (hash-table-map transitions
|
|
|
|
(lambda (state trans)
|
|
|
|
(lambda (state trans)
|
|
|
|
(cons (state-index state)
|
|
|
|
(cons (state-index state)
|
|
|
|
(map (lambda (t)
|
|
|
|
(map (lambda (t)
|
|
|
|
(cons (car t)
|
|
|
|
(cons (car t)
|
|
|
|
(state-index (cdr t))))
|
|
|
|
(state-index (cdr t))))
|
|
|
|
trans))))
|
|
|
|
trans))))
|
|
|
|
(lambda (a b) (< (car a) (car b))))))
|
|
|
|
(lambda (a b) (< (car a) (car b))))))
|
|
|
|
((null? old-states)
|
|
|
|
((null? old-states)
|
|
|
|
(loop new-states null all-states (compute-chars new-states)))
|
|
|
|
(loop new-states null all-states (compute-chars new-states)))
|
|
|
|
((null? cs)
|
|
|
|
((null? cs)
|
|
|
|