a6098862048d4bb469130b9ff21be3020d6f2c54Sumit Bose{- |
a6098862048d4bb469130b9ff21be3020d6f2c54Sumit BoseModule : $Id$
a6098862048d4bb469130b9ff21be3020d6f2c54Sumit BoseDescription : a standalone tptp parser
a6098862048d4bb469130b9ff21be3020d6f2c54Sumit BoseCopyright : (c) C.Maeder, DFKI Lab Bremen 2008
a6098862048d4bb469130b9ff21be3020d6f2c54Sumit BoseLicense : GPLv2 or higher, see LICENSE.txt
a6098862048d4bb469130b9ff21be3020d6f2c54Sumit Bose
a6098862048d4bb469130b9ff21be3020d6f2c54Sumit BoseMaintainer : Christian.Maeder@dfki.de
a6098862048d4bb469130b9ff21be3020d6f2c54Sumit BoseStability : provisional
a6098862048d4bb469130b9ff21be3020d6f2c54Sumit BosePortability : portable
a6098862048d4bb469130b9ff21be3020d6f2c54Sumit Bose
a6098862048d4bb469130b9ff21be3020d6f2c54Sumit Boseparse tptp v3.4.0.1 files
a6098862048d4bb469130b9ff21be3020d6f2c54Sumit Bose-}
a6098862048d4bb469130b9ff21be3020d6f2c54Sumit Bose
a6098862048d4bb469130b9ff21be3020d6f2c54Sumit Bosemodule Main where
a6098862048d4bb469130b9ff21be3020d6f2c54Sumit Bose
a6098862048d4bb469130b9ff21be3020d6f2c54Sumit Boseimport System.Environment
a6098862048d4bb469130b9ff21be3020d6f2c54Sumit Boseimport Text.ParserCombinators.Parsec
a6098862048d4bb469130b9ff21be3020d6f2c54Sumit Boseimport SoftFOL.ParseTPTP
a6098862048d4bb469130b9ff21be3020d6f2c54Sumit Bose
a6098862048d4bb469130b9ff21be3020d6f2c54Sumit Bosemain :: IO ()
a6098862048d4bb469130b9ff21be3020d6f2c54Sumit Bosemain = getArgs >>= mapM_ process
a6098862048d4bb469130b9ff21be3020d6f2c54Sumit Bose
a6098862048d4bb469130b9ff21be3020d6f2c54Sumit Boseprocess :: String -> IO ()
a6098862048d4bb469130b9ff21be3020d6f2c54Sumit Boseprocess f = do
a6098862048d4bb469130b9ff21be3020d6f2c54Sumit Bose s <- readFile f
a6098862048d4bb469130b9ff21be3020d6f2c54Sumit Bose case parse tptp f s of
a6098862048d4bb469130b9ff21be3020d6f2c54Sumit Bose Right b -> writeFile (f ++ ".tptp") $ shows (prTPTPs b) "\n"
8babbeee01e67893af4828ddfc922ecac0be4197Pavel Reichl Left err -> print err
a6098862048d4bb469130b9ff21be3020d6f2c54Sumit Bose