cComorphismsTo :: String -> CmdlState -> IO CmdlState
cComorphismsTo input state =
  case i_state $ intState state of
    -- nothing selected
    Nothing -> return state
    Just ps -> case getCurrentSublogic ps of
                Just start -> case parseSublogics input of
                                Just end ->
                                 let cmors = yen 10 (start, Nothing)
                                          (\ (l, _) -> isSubElemG l end)
                                          (logicGraph2Graph logicGraph)
                                     cmor = map (show . pathToComorphism) cmors
                                 in return $ genMessage ""
                                              (unlines cmor) state
                                Nothing -> return $ genMsgAndCode
                                            ("Invalid logic " ++ input) 1 state
                Nothing -> return $ genMsgAndCode
                                     "No node(s) selected!" 1 state

-- show all information of input
cComorphismsTo :: String -> CmdlState -> IO CmdlState
cComorphismsTo input state =
  case i_state $ intState state of
    -- nothing selected
    Nothing -> return state
    Just ps -> case getCurrentSublogic ps of
                Just start -> case parseSublogics input of
                                Just end ->
                                 let cmors = yen 10 (start, Nothing)
                                          (\ (l, _) -> isSubElemG l end)
                                          (logicGraph2Graph logicGraph)
                                     cmor = map (show . pathToComorphism) cmors
                                 in return $ genMessage ""
                                              (unlines cmor) state
                                Nothing -> return $ genMsgAndCode
                                            ("Invalid logic " ++ input) 1 state
                Nothing -> return $ genMsgAndCode
                                     "No node(s) selected!" 1 state

-- show all information of input
cComorphismsTo input state =
  case i_state $ intState state of
    -- nothing selected
    Nothing -> return state
    Just ps -> case getCurrentSublogic ps of
                Just start -> case parseSublogics input of
                                Just end ->
                                 let cmors = yen 10 (start, Nothing)
                                          (\ (l, _) -> isSubElemG l end)
                                          (logicGraph2Graph logicGraph)
                                     cmor = map (show . pathToComorphism) cmors
                                 in return $ genMessage ""
                                              (unlines cmor) state
                                Nothing -> return $ genMsgAndCode
                                            ("Invalid logic " ++ input) 1 state
                Nothing -> return $ genMsgAndCode
                                     "No node(s) selected!" 1 state

-- show all information of input