-- | Make transition for pair of sets of states,
--   as described in the article by Courcoubetis and Yannakakis
pairTrans :: (Ord q, Ord a) => NBA q a l -> PowerPair q -> [(PowerPair q, a)]
pairTrans a (qs1, qs2) = let
  ts1 = powerSucc a qs1
  acc1 = [f | f <- qs1, S.member f (accept a)]
  qs2' l = if qs1 == qs2 then
             powerASucc a acc1 l
           else
             powerASucc a (qs2 ++ [f | f <- acc1, not (f `elem` qs2)]) l
  in
   [((qs1', nub (qs2' l)), l) | (qs1', l) <- ts1]
pairTrans :: (Ord q, Ord a) => NBA q a l -> PowerPair q -> [(PowerPair q, a)]
pairTrans a (qs1, qs2) = let
  ts1 = powerSucc a qs1
  acc1 = [f | f <- qs1, S.member f (accept a)]
  qs2' l = if qs1 == qs2 then
             powerASucc a acc1 l
           else
             powerASucc a (qs2 ++ [f | f <- acc1, not (f `elem` qs2)]) l
  in
   [((qs1', nub (qs2' l)), l) | (qs1', l) <- ts1]
pairTrans a (qs1, qs2) = let
  ts1 = powerSucc a qs1
  acc1 = [f | f <- qs1, S.member f (accept a)]
  qs2' l = if qs1 == qs2 then
             powerASucc a acc1 l
           else
             powerASucc a (qs2 ++ [f | f <- acc1, not (f `elem` qs2)]) l
  in
   [((qs1', nub (qs2' l)), l) | (qs1', l) <- ts1]