cInfo :: String -> CmdlState -> IO CmdlState
cInfo input state =
  case i_state $ intState state of
    -- error message
    Nothing -> return $ genMsgAndCode "No library loaded" 1 state
    Just dgS ->
     let (nds, edg, nbEdg, errs) = decomposeIntoGoals input
         tmpErrs = prettyPrintErrList errs
     in case (nds, edg, nbEdg) of
          ([], [], []) -> return $ genMsgAndCode ("Nothing from the input "
                                       ++ "could be processed") 1 state
          (_, _, _) ->
            let lsNodes = getAllNodes dgS
                lsEdges = getAllEdges dgS
                (errs'', listEdges) = obtainEdgeList edg nbEdg lsNodes lsEdges
                (errs', listNodes) = obtainNodeList nds lsNodes
                strsNode = map showNodeInfo listNodes
                strsEdge = map showEdgeInfo listEdges
                tmpErrs' = tmpErrs ++ prettyPrintErrList errs'
                tmpErrs'' = tmpErrs' ++ prettyPrintErrList errs''
             in return $ genMessage tmpErrs''
                         (intercalate "\n\n" (strsNode ++ strsEdge)) state
cInfo :: String -> CmdlState -> IO CmdlState
cInfo input state =
  case i_state $ intState state of
    -- error message
    Nothing -> return $ genMsgAndCode "No library loaded" 1 state
    Just dgS ->
     let (nds, edg, nbEdg, errs) = decomposeIntoGoals input
         tmpErrs = prettyPrintErrList errs
     in case (nds, edg, nbEdg) of
          ([], [], []) -> return $ genMsgAndCode ("Nothing from the input "
                                       ++ "could be processed") 1 state
          (_, _, _) ->
            let lsNodes = getAllNodes dgS
                lsEdges = getAllEdges dgS
                (errs'', listEdges) = obtainEdgeList edg nbEdg lsNodes lsEdges
                (errs', listNodes) = obtainNodeList nds lsNodes
                strsNode = map showNodeInfo listNodes
                strsEdge = map showEdgeInfo listEdges
                tmpErrs' = tmpErrs ++ prettyPrintErrList errs'
                tmpErrs'' = tmpErrs' ++ prettyPrintErrList errs''
             in return $ genMessage tmpErrs''
                         (intercalate "\n\n" (strsNode ++ strsEdge)) state
cInfo input state =
  case i_state $ intState state of
    -- error message
    Nothing -> return $ genMsgAndCode "No library loaded" 1 state
    Just dgS ->
     let (nds, edg, nbEdg, errs) = decomposeIntoGoals input
         tmpErrs = prettyPrintErrList errs
     in case (nds, edg, nbEdg) of
          ([], [], []) -> return $ genMsgAndCode ("Nothing from the input "
                                       ++ "could be processed") 1 state
          (_, _, _) ->
            let lsNodes = getAllNodes dgS
                lsEdges = getAllEdges dgS
                (errs'', listEdges) = obtainEdgeList edg nbEdg lsNodes lsEdges
                (errs', listNodes) = obtainNodeList nds lsNodes
                strsNode = map showNodeInfo listNodes
                strsEdge = map showEdgeInfo listEdges
                tmpErrs' = tmpErrs ++ prettyPrintErrList errs'
                tmpErrs'' = tmpErrs' ++ prettyPrintErrList errs''
             in return $ genMessage tmpErrs''
                         (intercalate "\n\n" (strsNode ++ strsEdge)) state