ProveSPASS.hs revision 433bb7cb49200f4e6c7341101da25309e423c0e2
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian MaederModule : $Header$
f9e0b18852b238ddb649d341194e05d7200d1bbeChristian MaederDescription : Interface for the SPASS theorem prover.
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian MaederCopyright : (c) Rene Wagner, Klaus Luettich, Rainer Grabbe,
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder Uni Bremen 2005-2006
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian MaederLicense : similar to LGPL, see HetCATS/LICENSE.txt or LIZENZ.txt
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian MaederMaintainer : rainer25@informatik.uni-bremen.de
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian MaederStability : provisional
f9e0b18852b238ddb649d341194e05d7200d1bbeChristian MaederPortability : needs POSIX
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian MaederInterface for the SPASS theorem prover, uses GUI.GenericATP.
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian MaederSee <http://spass.mpi-sb.mpg.de/> for details on SPASS.
f9e0b18852b238ddb649d341194e05d7200d1bbeChristian Maeder - check if the theorem is used in the proof;
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder if not, the theory is inconsistent;
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder mark goal as proved and emmit a warning...
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder - Implement a consistency checker based on GUI
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maedermodule SoftFOL.ProveSPASS (spassProver,
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder spassProveGUI,
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder spassProveCMDLautomatic,
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder spassProveCMDLautomaticBatch) where
67869d63d1725c79e4c07b51acd466a31932b275Christian Maederimport ChildProcess as CP
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maederimport ProcessClasses
62eaa2fb831613d8a6e59687f83a45be1041ab17Christian Maederimport qualified Common.AS_Annotation as AS_Anno
62eaa2fb831613d8a6e59687f83a45be1041ab17Christian Maederimport qualified Common.Result as Result
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maederimport Common.Utils (splitOn)
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maederimport qualified Control.Concurrent as Concurrent
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maederimport qualified Control.Exception as Exception
62eaa2fb831613d8a6e59687f83a45be1041ab17Christian Maederimport Data.Time (TimeOfDay(..),midnight -- only in ghc-6.6.1: ,parseTime
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder-- * Prover implementation
67869d63d1725c79e4c07b51acd466a31932b275Christian Maeder The Prover implementation.
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder Implemented are: a prover GUI, and both commandline prover interfaces.
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian MaederspassProver :: Prover Sign Sentence SoftFOLMorphism () ProofTree
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian MaederspassProver = (mkProverTemplate "SPASS" () spassProveGUI)
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder { proveCMDLautomatic = Just spassProveCMDLautomatic
67869d63d1725c79e4c07b51acd466a31932b275Christian Maeder , proveCMDLautomaticBatch = Just spassProveCMDLautomaticBatch }
62eaa2fb831613d8a6e59687f83a45be1041ab17Christian Maeder-- * Main prover functions
62eaa2fb831613d8a6e59687f83a45be1041ab17Christian Maeder-- ** Utility functions
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder Record for prover specific functions. This is used by both GUI and command
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder line interface.
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian MaederatpFun :: String -- ^ theory name
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder -> ATPFunctions Sign Sentence ProofTree SoftFOLProverState
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian MaederatpFun thName = ATPFunctions
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder { initialProverState = spassProverState,
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder atpTransSenName = transSenName,
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder atpInsertSentence = insertSentenceGen,
67869d63d1725c79e4c07b51acd466a31932b275Christian Maeder goalOutput = showDFGProblem thName,
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder proverHelpText = "http://www.spass-prover.org/\n",
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder batchTimeEnv = "HETS_SPASS_BATCH_TIME_LIMIT",
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder fileExtensions = FileExtensions{problemOutput = ".dfg",
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder proverOutput = ".spass",
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder theoryConfiguration = ".spcf"},
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder runProver = runSpass,
67869d63d1725c79e4c07b51acd466a31932b275Christian Maeder createProverOptions = createSpassOptions }
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder Parses a given default tactic script into a
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder 'GUI.GenericATPState.ATPTactic_script' if possible. Otherwise a default
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder SPASS tactic script is returned.
67869d63d1725c79e4c07b51acd466a31932b275Christian MaederparseSpassTactic_script :: Tactic_script
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder -> ATPTactic_script
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian MaederparseSpassTactic_script =
1bc5dccbf0083a620ae1181c717fea75e4af5e5cChristian Maeder parseTactic_script batchTimeLimit ["-Stdin", "-DocProof"]
Implementation of 'Logic.Prover.proveCMDLautomatic' which provides an
-> IO (Result.Result ([Proof_status ProofTree]))
Implementation of 'Logic.Prover.proveCMDLautomaticBatch' which provides an
_ -> error "SoftFOL.Prove: wrong time format"
-> AS_Anno.Named SPTerm -- ^ goal to prove
spass <- newChildProcess "SPASS" [CP.arguments allOptions]
Exception.catch (runSpassReal spass)
(AS_Anno.senAttr nGoal) emptyProofTree)
(writeFile (thName++'_':AS_Anno.senAttr nGoal++".dfg") prob)
(openProof_status (AS_Anno.senAttr nGoal) (prover_name spassProver) $
{ goalStatus = Proved $ if elem (AS_Anno.senAttr nGoal) usedAxs
, usedAxioms = filter (/=(AS_Anno.senAttr nGoal)) usedAxs