summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcyfraeviolae <cyfraeviolae>2021-05-18 19:35:59 -0400
committercyfraeviolae <cyfraeviolae>2021-05-18 19:35:59 -0400
commitb66ac09af03b69d409df27ef32c90fa38924af2f (patch)
tree1c5268c5ef9d56e5ab07b7538d2e3ba0ab611f99 /src
parentcabe9f41850e7dd100a17153989a97a45d178da5 (diff)
fix additive identity example
Diffstat (limited to 'src')
-rw-r--r--src/Lib.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Lib.hs b/src/Lib.hs
index 13dc4ac..e8bc698 100644
--- a/src/Lib.hs
+++ b/src/Lib.hs
@@ -209,6 +209,8 @@ chars n =
in map (1 :) r ++ map (0 :) r
minimize :: (Ord a) => Integer -> NFA [Int] a -> NFA [Int] a
-minimize n nfa@(NFA _ starts accepts f) = NFA states' starts accepts f
+minimize n nfa@(NFA _ starts accepts f) = NFA states' starts' accepts' f
where
states' = closure nfa (chars n) starts
+ starts' = starts `L.intersect` states'
+ accepts' = accepts `L.intersect` states'