PrintLogics.hs revision 65853214a355ddc2fc7e4f1edc5ee8d05947b84a
3bff7aaa07a352bd10cc96781a2a5334beef9868Till Mossakowski{- |
3bff7aaa07a352bd10cc96781a2a5334beef9868Till MossakowskiModule : ./Logic/PrintLogics.hs
3bff7aaa07a352bd10cc96781a2a5334beef9868Till MossakowskiDescription : Print list of all logics
3bff7aaa07a352bd10cc96781a2a5334beef9868Till MossakowskiCopyright : (c) Till Mossakowski, and OvGU Magdeburg 2017
3bff7aaa07a352bd10cc96781a2a5334beef9868Till MossakowskiLicense : GPLv2 or higher, see LICENSE.txt
3bff7aaa07a352bd10cc96781a2a5334beef9868Till MossakowskiMaintainer : till@iks.cs.ovgu.de
3bff7aaa07a352bd10cc96781a2a5334beef9868Till MossakowskiStability : provisional
3bff7aaa07a352bd10cc96781a2a5334beef9868Till MossakowskiPortability : non-portable (various -fglasgow-exts extensions)
3bff7aaa07a352bd10cc96781a2a5334beef9868Till Mossakowski
3bff7aaa07a352bd10cc96781a2a5334beef9868Till MossakowskiPrint list of all logics with some useful information.
3bff7aaa07a352bd10cc96781a2a5334beef9868Till Mossakowski
3bff7aaa07a352bd10cc96781a2a5334beef9868Till Mossakowski-}
3bff7aaa07a352bd10cc96781a2a5334beef9868Till Mossakowski
3bff7aaa07a352bd10cc96781a2a5334beef9868Till Mossakowskimodule Logic.PrintLogics where
3bff7aaa07a352bd10cc96781a2a5334beef9868Till Mossakowski
3bff7aaa07a352bd10cc96781a2a5334beef9868Till Mossakowskiimport Comorphisms.LogicList
3bff7aaa07a352bd10cc96781a2a5334beef9868Till Mossakowskiimport Logic.Prover
3bff7aaa07a352bd10cc96781a2a5334beef9868Till Mossakowskiimport Logic.Logic
3bff7aaa07a352bd10cc96781a2a5334beef9868Till Mossakowskiimport Control.Monad
3bff7aaa07a352bd10cc96781a2a5334beef9868Till Mossakowskiimport Data.List
3bff7aaa07a352bd10cc96781a2a5334beef9868Till Mossakowski
31bc219bae758272d0f064281b8ce7740a4553e9Till MossakowskiprintLogics :: IO ()
31bc219bae758272d0f064281b8ce7740a4553e9Till MossakowskiprintLogics = do
3bff7aaa07a352bd10cc96781a2a5334beef9868Till Mossakowski putStrLn "*** List of logics in Hets ***"
31bc219bae758272d0f064281b8ce7740a4553e9Till Mossakowski mapM_ printLogicsWithStability [Stable, Testing, Experimental, Unstable]
3bff7aaa07a352bd10cc96781a2a5334beef9868Till Mossakowski
3bff7aaa07a352bd10cc96781a2a5334beef9868Till MossakowskihasStability :: Stability -> AnyLogic -> Bool
3bff7aaa07a352bd10cc96781a2a5334beef9868Till MossakowskihasStability s (Logic l) = stability l == s
3bff7aaa07a352bd10cc96781a2a5334beef9868Till Mossakowski
31bc219bae758272d0f064281b8ce7740a4553e9Till MossakowskiprintLogicsWithStability :: Stability -> IO ()
31bc219bae758272d0f064281b8ce7740a4553e9Till MossakowskiprintLogicsWithStability s = do
3bff7aaa07a352bd10cc96781a2a5334beef9868Till Mossakowski putStrLn $ "Stability: "++show s
3bff7aaa07a352bd10cc96781a2a5334beef9868Till Mossakowski mapM_ printLogic $ filter (hasStability s) logicList
3bff7aaa07a352bd10cc96781a2a5334beef9868Till Mossakowski
3bff7aaa07a352bd10cc96781a2a5334beef9868Till MossakowskiprintLogic :: AnyLogic -> IO ()
3bff7aaa07a352bd10cc96781a2a5334beef9868Till MossakowskiprintLogic (Logic l) = do
65853214a355ddc2fc7e4f1edc5ee8d05947b84aTill Mossakowski putStrLn $ " "++show l++": "++short_description l
3bff7aaa07a352bd10cc96781a2a5334beef9868Till Mossakowski let ps = provers l
3bff7aaa07a352bd10cc96781a2a5334beef9868Till Mossakowski unless (null ps) $ do
3bff7aaa07a352bd10cc96781a2a5334beef9868Till Mossakowski putStr " provers: "
3bff7aaa07a352bd10cc96781a2a5334beef9868Till Mossakowski putStrLn $ concat $ intersperse ", " $ map proverName ps
3bff7aaa07a352bd10cc96781a2a5334beef9868Till Mossakowski