summaryrefslogtreecommitdiff
path: root/source/CommandLine.hs
diff options
context:
space:
mode:
Diffstat (limited to 'source/CommandLine.hs')
-rw-r--r--source/CommandLine.hs64
1 files changed, 46 insertions, 18 deletions
diff --git a/source/CommandLine.hs b/source/CommandLine.hs
index a9fb00d..b8c170e 100644
--- a/source/CommandLine.hs
+++ b/source/CommandLine.hs
@@ -18,7 +18,7 @@ import UnliftIO
import UnliftIO.Directory
import UnliftIO.Environment (lookupEnv)
import System.FilePath.Posix
-
+import qualified Tptp.UnsortedFirstOrder as Syntax.Internal
runCommandLine :: IO ()
runCommandLine = do
@@ -43,10 +43,12 @@ run = do
case withDump opts of
WithoutDump -> skip
WithDump dir -> do
+ liftIO (Text.putStrLn "\ESC[1;36mCreating Dumpfiles.\ESC[0m")
let serials = [dir </> show n <.> "p" | n :: Int <- [1..]]
tasks <- zip serials <$> encodeTasks (inputPath opts)
createDirectoryIfMissing True dir
forM_ tasks (uncurry dumpTask)
+ liftIO (Text.putStrLn "\ESC[35mDump ready.\ESC[0m")
case (withParseOnly opts, withMegalodon opts) of
(WithParseOnly, _) -> do
ast <- parse (inputPath opts)
@@ -60,6 +62,7 @@ run = do
-- A custom E executable can be configured using environment variables.
-- If the environment variable is undefined we fall back to the
-- a globally installed E executable.
+ liftIO (Text.putStrLn "\ESC[1;96mStart of verification.\ESC[0m")
vampirePathPath <- (?? "vampire") <$> lookupEnv "NAPROCHE_VAMPIRE"
eproverPath <- (?? "eprover") <$> lookupEnv "NAPROCHE_EPROVER"
let prover = case withProver opts of
@@ -69,23 +72,43 @@ run = do
WithDefaultProver -> Provers.vampire vampirePathPath
let proverInstance = prover Provers.Silent (withTimeLimit opts) (withMemoryLimit opts)
result <- verify proverInstance (inputPath opts)
- liftIO case result of
- VerificationSuccess -> (Text.putStrLn "Verification successful.")
- VerificationFailure [] -> error "Empty verification fail"
- VerificationFailure ((_, proverAnswer) : _) -> case proverAnswer of
- Yes ->
- skip
- No tptp -> do
- putStrLn "Verification failed: prover found countermodel"
- Text.hPutStrLn stderr tptp
- ContradictoryAxioms tptp -> do
- putStrLn "Verification failed: contradictory axioms"
- Text.hPutStrLn stderr tptp
- Uncertain tptp -> do
- putStrLn "Verification failed: out of resources"
- Text.hPutStrLn stderr tptp
- Error err ->
- Text.hPutStrLn stderr err
+ case withFailList opts of
+ WithoutFailList -> liftIO case result of
+ VerificationSuccess -> putStrLn "Verification successful."
+ VerificationFailure [] -> error "Empty verification fail"
+ VerificationFailure ((_, proverAnswer) : _) -> case proverAnswer of
+ Yes ->
+ skip
+ No tptp -> do
+ putStrLn "Verification failed: prover found countermodel"
+ Text.hPutStrLn stderr tptp
+ ContradictoryAxioms tptp -> do
+ putStrLn "Verification failed: contradictory axioms"
+ Text.hPutStrLn stderr tptp
+ Uncertain tptp -> do
+ putStrLn "Verification failed: out of resources"
+ Text.hPutStrLn stderr tptp
+ Error err tptp task -> do
+ putStr "Error at:"
+
+ Text.putStrLn task
+ Text.putStrLn err
+ Text.putStrLn tptp
+
+ WithFailList -> liftIO case result of
+ VerificationSuccess -> putStrLn "\ESC[32mVerification successful.\ESC[0m"
+ VerificationFailure [] -> error "Empty verification fail"
+ VerificationFailure fails -> do
+ putStrLn "\ESC[35mFollowing task couldn't be solved by the ATP: \ESC[0m"
+ traverse_ showFailedTask fails
+ Text.hPutStrLn stderr "Don't give up!"
+
+
+
+
+
+
+
@@ -104,6 +127,7 @@ parseOptions = do
withVersion <- withVersionParser
withMegalodon <- withMegalodonParser
withDumpPremselTraining <- withDumpPremselTrainingParser
+ withFailList <- withFailListParser
pure Options{..}
withTimeLimitParser :: Parser Provers.TimeLimit
@@ -160,3 +184,7 @@ withDumpPremselTrainingParser = flag' WithDumpPremselTraining (long "premseldump
withMegalodonParser :: Parser WithMegalodon
withMegalodonParser = flag' WithMegalodon (long "megalodon" <> help "Export to Megalodon.")
<|> pure WithoutMegalodon -- Default to using the cache.
+
+withFailListParser :: Parser WithFailList
+withFailListParser = flag' WithFailList (long "list_fails" <> help "Will list all unproven task with possible reason of failure.")
+ <|> pure WithoutFailList -- Default to using the cache. \ No newline at end of file