replaceQualifier pns qual  t
    =applyTP (full_tdTP (adhocTP idTP rename)) t
       where
         rename  pnt@(PNT pn ty loc)
          |isQualifiedPN pn && elem pn pns 
          = do let pnt'=PNT (replaceQual pn qual) ty loc
               update pnt pnt' pnt
             where 
              replaceQual (PN (Qual modName  s) l) qual = PN (Qual qual s) l             
              replaceQual pn _ = pn
         rename x=return x
replaceQualifier pns qual  t
    =applyTP (full_tdTP (adhocTP idTP rename)) t
       where
         rename  pnt@(PNT pn ty loc)
          |isQualifiedPN pn && elem pn pns 
          = do let pnt'=PNT (replaceQual pn qual) ty loc
               update pnt pnt' pnt
             where 
              replaceQual (PN (Qual modName  s) l) qual = PN (Qual qual s) l             
              replaceQual pn _ = pn
         rename x=return x
replaceQualifier pns qual  t
    =applyTP (full_tdTP (adhocTP idTP rename)) t
       where
         rename  pnt@(PNT pn ty loc)
          |isQualifiedPN pn && elem pn pns 
          = do let pnt'=PNT (replaceQual pn qual) ty loc
               update pnt pnt' pnt
             where 
              replaceQual (PN (Qual modName  s) l) qual = PN (Qual qual s) l             
              replaceQual pn _ = pn
         rename x=return x