th i j k dfa =
  union [kPath i j (k - 1) dfa
        ,concat [kPath i k (k - 1) dfa
                ,closure (kPath k k (k - 1) dfa)
                ,kPath k j (k - 1) dfa
                ]]



kPath i j k dfa =
  union [kPath i j (k - 1) dfa
        ,concat [kPath i k (k - 1) dfa
                ,closure (kPath k k (k - 1) dfa)
                ,kPath k j (k - 1) dfa
                ]]
kPath i j k dfa =
  union [kPath i j (k - 1) dfa
        ,concat [kPath i k (k - 1) dfa
                ,closure (kPath k k (k - 1) dfa)
                ,kPath k j (k - 1) dfa
                ]]