debugAuxiliaryInfo :: AuxiliaryInfo -> String -> IO ()
debugAuxiliaryInfo aux desc =
  aux `seq` auxVarMemMappings aux `seq` auxMemAliases aux `seq`
  auxVarAliases aux `seq` auxFirstUses aux `seq` auxLastUses aux `seq`
  auxInterferences aux `seq` auxPotentialKernelDataRaceInterferences `seq`
  auxActualVariables aux `seq` auxExistentials aux `seq` do
  putStrLn $ replicate 70 '='
  putStrLn (desc ++ ": Helper info in " ++ pretty (auxName aux) ++ ":")
  putStrLn $ replicate 70 '-'
  putStrLn "Variable-to-memory mappings:"
  forM_ (M.assocs $ auxVarMemMappings aux) $ \(var, memloc) ->
    putStrLn ("For " ++ pretty var ++ ": " ++
              pretty (memSrcName memloc) ++ ", " ++ show (memSrcIxFun memloc))
  putStrLn $ replicate 70 '-'
  putStrLn "Memory aliases:"
  forM_ (M.assocs $ auxMemAliases aux) $ \(mem, aliases) ->
    putStrLn ("For " ++ pretty mem ++ ": " ++ prettySet aliases)
  putStrLn $ replicate 70 '-'
  putStrLn "Variables aliases:"
  forM_ (M.assocs $ auxVarAliases aux) $ \(var, aliases) ->
    putStrLn ("For " ++ pretty var ++ ": " ++ prettySet aliases)
  putStrLn $ replicate 70 '-'
  putStrLn "First uses of memory:"
  forM_ (M.assocs $ auxFirstUses aux) $ \(stmt_var, mems) ->
    putStrLn ("In " ++ pretty stmt_var ++ ": " ++ prettySet mems)
  putStrLn $ replicate 70 '-'
  putStrLn "Last uses of memory:"
  forM_ (M.assocs $ auxLastUses aux) $ \(var, mems) -> do
    let pret = case var of
          FromStm stmt_var -> "stm@" ++ pretty stmt_var
          FromRes res_var -> "res@" ++ pretty res_var
    putStrLn ("In " ++ pret ++ ": " ++ prettySet mems)
  putStrLn $ replicate 70 '-'
  putStrLn "Interferences of memory blocks:"
  forM_ (M.assocs $ auxInterferences aux) $ \(mem, mems) ->
    putStrLn ("In " ++ pretty mem ++ ": " ++ prettySet mems)
  putStrLn $ replicate 70 '-'
  putStrLn "Potential kernel data race interferences of memory blocks:"
  forM_ (auxPotentialKernelDataRaceInterferences aux) $ mapM_ print
  putStrLn $ replicate 70 '-'
  putStrLn "Actual variables:"
  forM_ (M.assocs $ auxActualVariables aux) $ \(var, vars) ->
    putStrLn ("For " ++ pretty var ++ ": " ++ prettySet vars)
  putStrLn $ replicate 70 '-'
  putStrLn "Existentials:"
  putStrLn $ prettySet $ auxExistentials aux
  putStrLn $ replicate 70 '='
  putStrLn ""
debugAuxiliaryInfo :: AuxiliaryInfo -> String -> IO ()
debugAuxiliaryInfo aux desc =
  aux `seq` auxVarMemMappings aux `seq` auxMemAliases aux `seq`
  auxVarAliases aux `seq` auxFirstUses aux `seq` auxLastUses aux `seq`
  auxInterferences aux `seq` auxPotentialKernelDataRaceInterferences `seq`
  auxActualVariables aux `seq` auxExistentials aux `seq` do
  putStrLn $ replicate 70 '='
  putStrLn (desc ++ ": Helper info in " ++ pretty (auxName aux) ++ ":")
  putStrLn $ replicate 70 '-'
  putStrLn "Variable-to-memory mappings:"
  forM_ (M.assocs $ auxVarMemMappings aux) $ \(var, memloc) ->
    putStrLn ("For " ++ pretty var ++ ": " ++
              pretty (memSrcName memloc) ++ ", " ++ show (memSrcIxFun memloc))
  putStrLn $ replicate 70 '-'
  putStrLn "Memory aliases:"
  forM_ (M.assocs $ auxMemAliases aux) $ \(mem, aliases) ->
    putStrLn ("For " ++ pretty mem ++ ": " ++ prettySet aliases)
  putStrLn $ replicate 70 '-'
  putStrLn "Variables aliases:"
  forM_ (M.assocs $ auxVarAliases aux) $ \(var, aliases) ->
    putStrLn ("For " ++ pretty var ++ ": " ++ prettySet aliases)
  putStrLn $ replicate 70 '-'
  putStrLn "First uses of memory:"
  forM_ (M.assocs $ auxFirstUses aux) $ \(stmt_var, mems) ->
    putStrLn ("In " ++ pretty stmt_var ++ ": " ++ prettySet mems)
  putStrLn $ replicate 70 '-'
  putStrLn "Last uses of memory:"
  forM_ (M.assocs $ auxLastUses aux) $ \(var, mems) -> do
    let pret = case var of
          FromStm stmt_var -> "stm@" ++ pretty stmt_var
          FromRes res_var -> "res@" ++ pretty res_var
    putStrLn ("In " ++ pret ++ ": " ++ prettySet mems)
  putStrLn $ replicate 70 '-'
  putStrLn "Interferences of memory blocks:"
  forM_ (M.assocs $ auxInterferences aux) $ \(mem, mems) ->
    putStrLn ("In " ++ pretty mem ++ ": " ++ prettySet mems)
  putStrLn $ replicate 70 '-'
  putStrLn "Potential kernel data race interferences of memory blocks:"
  forM_ (auxPotentialKernelDataRaceInterferences aux) $ mapM_ print
  putStrLn $ replicate 70 '-'
  putStrLn "Actual variables:"
  forM_ (M.assocs $ auxActualVariables aux) $ \(var, vars) ->
    putStrLn ("For " ++ pretty var ++ ": " ++ prettySet vars)
  putStrLn $ replicate 70 '-'
  putStrLn "Existentials:"
  putStrLn $ prettySet $ auxExistentials aux
  putStrLn $ replicate 70 '='
  putStrLn ""
debugAuxiliaryInfo aux desc =
  aux `seq` auxVarMemMappings aux `seq` auxMemAliases aux `seq`
  auxVarAliases aux `seq` auxFirstUses aux `seq` auxLastUses aux `seq`
  auxInterferences aux `seq` auxPotentialKernelDataRaceInterferences `seq`
  auxActualVariables aux `seq` auxExistentials aux `seq` do
  putStrLn $ replicate 70 '='
  putStrLn (desc ++ ": Helper info in " ++ pretty (auxName aux) ++ ":")
  putStrLn $ replicate 70 '-'
  putStrLn "Variable-to-memory mappings:"
  forM_ (M.assocs $ auxVarMemMappings aux) $ \(var, memloc) ->
    putStrLn ("For " ++ pretty var ++ ": " ++
              pretty (memSrcName memloc) ++ ", " ++ show (memSrcIxFun memloc))
  putStrLn $ replicate 70 '-'
  putStrLn "Memory aliases:"
  forM_ (M.assocs $ auxMemAliases aux) $ \(mem, aliases) ->
    putStrLn ("For " ++ pretty mem ++ ": " ++ prettySet aliases)
  putStrLn $ replicate 70 '-'
  putStrLn "Variables aliases:"
  forM_ (M.assocs $ auxVarAliases aux) $ \(var, aliases) ->
    putStrLn ("For " ++ pretty var ++ ": " ++ prettySet aliases)
  putStrLn $ replicate 70 '-'
  putStrLn "First uses of memory:"
  forM_ (M.assocs $ auxFirstUses aux) $ \(stmt_var, mems) ->
    putStrLn ("In " ++ pretty stmt_var ++ ": " ++ prettySet mems)
  putStrLn $ replicate 70 '-'
  putStrLn "Last uses of memory:"
  forM_ (M.assocs $ auxLastUses aux) $ \(var, mems) -> do
    let pret = case var of
          FromStm stmt_var -> "stm@" ++ pretty stmt_var
          FromRes res_var -> "res@" ++ pretty res_var
    putStrLn ("In " ++ pret ++ ": " ++ prettySet mems)
  putStrLn $ replicate 70 '-'
  putStrLn "Interferences of memory blocks:"
  forM_ (M.assocs $ auxInterferences aux) $ \(mem, mems) ->
    putStrLn ("In " ++ pretty mem ++ ": " ++ prettySet mems)
  putStrLn $ replicate 70 '-'
  putStrLn "Potential kernel data race interferences of memory blocks:"
  forM_ (auxPotentialKernelDataRaceInterferences aux) $ mapM_ print
  putStrLn $ replicate 70 '-'
  putStrLn "Actual variables:"
  forM_ (M.assocs $ auxActualVariables aux) $ \(var, vars) ->
    putStrLn ("For " ++ pretty var ++ ": " ++ prettySet vars)
  putStrLn $ replicate 70 '-'
  putStrLn "Existentials:"
  putStrLn $ prettySet $ auxExistentials aux
  putStrLn $ replicate 70 '='
  putStrLn ""