nnotateEachSecretChannels (ProcessAction ac an p) svars
  | (ChIn (Just t1) _) <- ac, Lit (Var v) <- viewTerm t1 =
      if S.member v svars then
        (ProcessAction ac (an `mappend` annSecretChannel (AnLVar v)) p')
      else
        (ProcessAction ac an p')
  | (ChOut (Just t1) _) <- ac, Lit (Var v) <- viewTerm t1 =
      if S.member v svars then
        (ProcessAction ac (an `mappend` annSecretChannel (AnLVar v)) p')
      else
        (ProcessAction ac an p')                           
  | otherwise = (ProcessAction ac an p')
  where p'= annotateEachSecretChannels p svars

annotateEachSecretChannels (ProcessAction ac an p) svars
  | (ChIn (Just t1) _) <- ac, Lit (Var v) <- viewTerm t1 =
      if S.member v svars then
        (ProcessAction ac (an `mappend` annSecretChannel (AnLVar v)) p')
      else
        (ProcessAction ac an p')
  | (ChOut (Just t1) _) <- ac, Lit (Var v) <- viewTerm t1 =
      if S.member v svars then
        (ProcessAction ac (an `mappend` annSecretChannel (AnLVar v)) p')
      else
        (ProcessAction ac an p')                           
  | otherwise = (ProcessAction ac an p')
  where p'= annotateEachSecretChannels p svars
annotateEachSecretChannels (ProcessAction ac an p) svars
  | (ChIn (Just t1) _) <- ac, Lit (Var v) <- viewTerm t1 =
      if S.member v svars then
        (ProcessAction ac (an `mappend` annSecretChannel (AnLVar v)) p')
      else
        (ProcessAction ac an p')
  | (ChOut (Just t1) _) <- ac, Lit (Var v) <- viewTerm t1 =
      if S.member v svars then
        (ProcessAction ac (an `mappend` annSecretChannel (AnLVar v)) p')
      else
        (ProcessAction ac an p')                           
  | otherwise = (ProcessAction ac an p')
  where p'= annotateEachSecretChannels p svars