ProvePellet.hs revision c3f7e132e0c214b755c6c4b485f4748c4dd1595c
8cc6f43935309fe1206828425baf6fc35a88d575Martin KühlModule : $Header$
e9458b1a7a19a63aa4c179f9ab20f4d50681c168Jens ElknerDescription : Interface to the OWL Ontology prover via Pellet.
8cc6f43935309fe1206828425baf6fc35a88d575Martin KühlCopyright : (c) Heng Jiang, Uni Bremen 2004-2008
8cc6f43935309fe1206828425baf6fc35a88d575Martin KühlLicense : similar to LGPL, see HetCATS/LICENSE.txt or LIZENZ.txt
98890889ffb2e8f6f722b00e265a211f13b5a861Corneliu-Claudiu ProdescuMaintainer : jiang@informatik.uni-bremen.de
8cc6f43935309fe1206828425baf6fc35a88d575Martin KühlStability : provisional
8cc6f43935309fe1206828425baf6fc35a88d575Martin KühlPortability : needs POSIX
8cc6f43935309fe1206828425baf6fc35a88d575Martin KühlInterface for the Pellet service, uses GUI.GenericATP.
8cc6f43935309fe1206828425baf6fc35a88d575Martin KühlSee <http://www.w3.org/2004/OWL/> for details on OWL, and
8cc6f43935309fe1206828425baf6fc35a88d575Martin Kühlmodule OWL.ProvePellet (pelletProver,pelletGUI,pelletCMDLautomatic,
8cc6f43935309fe1206828425baf6fc35a88d575Martin Kühl pelletCMDLautomaticBatch,
8cc6f43935309fe1206828425baf6fc35a88d575Martin Kühl pelletConsChecker) where
8cc6f43935309fe1206828425baf6fc35a88d575Martin Kühlimport GUI.Utils (createTextSaveDisplay, infoDialog)
d2020d73b5be74ca654c2facd411387941c6b206Martin Kühlimport Common.Result as Result
521e1648b2c66064c41e9ac47bcd510356ed2355Adrián Riescoimport Data.List (isPrefixOf)
26b4844ded8825ca5925fb5e9231e663095be699Martin Kühlimport Data.Time (timeToTimeOfDay)
d2020d73b5be74ca654c2facd411387941c6b206Martin Kühlimport Data.Time.Clock (UTCTime(..), secondsToDiffTime, getCurrentTime)
d2020d73b5be74ca654c2facd411387941c6b206Martin Kühlimport qualified Control.Concurrent as Concurrent
d2020d73b5be74ca654c2facd411387941c6b206Martin Kühldata PelletProverState = PelletProverState
d2020d73b5be74ca654c2facd411387941c6b206Martin Kühl { ontologySign :: Sign
d2020d73b5be74ca654c2facd411387941c6b206Martin Kühl , initialState :: [Named Axiom] }
26b4844ded8825ca5925fb5e9231e663095be699Martin Kühl deriving (Show)
d2020d73b5be74ca654c2facd411387941c6b206Martin Kühldata PelletProblem = PelletProblem
d2020d73b5be74ca654c2facd411387941c6b206Martin Kühl { identifier :: PelletID
d2020d73b5be74ca654c2facd411387941c6b206Martin Kühl -- , description :: Description
26b4844ded8825ca5925fb5e9231e663095be699Martin Kühl , problemProverState :: PelletProverState
d2020d73b5be74ca654c2facd411387941c6b206Martin Kühl -- , settings :: [PelletSetting]
d2020d73b5be74ca654c2facd411387941c6b206Martin Kühl } deriving (Show)
d2020d73b5be74ca654c2facd411387941c6b206Martin Kühltype PelletID = String
f78126c371b40713bdf7268be1e871198bb6aecfAdrián Riescodata PelletSetting = PelletSetting
f78126c371b40713bdf7268be1e871198bb6aecfAdrián Riesco { settingName :: String
26b4844ded8825ca5925fb5e9231e663095be699Martin Kühl , settingValue :: [String]
f78126c371b40713bdf7268be1e871198bb6aecfAdrián Riesco } deriving (Show)
26b4844ded8825ca5925fb5e9231e663095be699Martin Kühl-- * Prover implementation
d2020d73b5be74ca654c2facd411387941c6b206Martin KühlpelletProverState :: Sign
d2020d73b5be74ca654c2facd411387941c6b206Martin Kühl -> [Named Axiom]
d2020d73b5be74ca654c2facd411387941c6b206Martin Kühl -> [FreeDefMorphism Axiom OWLMorphism] -- ^ freeness constraints
26b4844ded8825ca5925fb5e9231e663095be699Martin Kühl -> PelletProverState
d2020d73b5be74ca654c2facd411387941c6b206Martin KühlpelletProverState sig oSens _ = PelletProverState
d2020d73b5be74ca654c2facd411387941c6b206Martin Kühl { ontologySign = sig
d2020d73b5be74ca654c2facd411387941c6b206Martin Kühl ,initialState = filter isAxiom oSens }
010997ddd12186698c1ebdbcddb63a670552b3c2Adrián Riesco The Prover implementation. First runs the batch prover (with graphical feedback), then starts the GUI prover.
010997ddd12186698c1ebdbcddb63a670552b3c2Adrián RiescopelletProver :: Prover Sign Axiom OWLMorphism OWLSub ProofTree
010997ddd12186698c1ebdbcddb63a670552b3c2Adrián RiescopelletProver = (mkProverTemplate "Pellet" sl_top pelletGUI)
1d48923f0ec0898cfc40df24690af805fa4369edAdrián Riesco { proveCMDLautomatic = Just pelletCMDLautomatic
1d48923f0ec0898cfc40df24690af805fa4369edAdrián Riesco , proveCMDLautomaticBatch = Just pelletCMDLautomaticBatch }
1d48923f0ec0898cfc40df24690af805fa4369edAdrián RiescopelletConsChecker :: ConsChecker Sign Axiom OWLSub
d2020d73b5be74ca654c2facd411387941c6b206Martin Kühl OWLMorphism ProofTree
ccead401e8728af7734715b70ec4f5c34096b683Martin KühlpelletConsChecker = (mkProverTemplate "Pellet Consistency Checker" sl_top
ccead401e8728af7734715b70ec4f5c34096b683Martin Kühl (\ s -> consCheck True s $ TacticScript "800"))
ccead401e8728af7734715b70ec4f5c34096b683Martin Kühl { proveCMDLautomatic = Just
ccead401e8728af7734715b70ec4f5c34096b683Martin Kühl $ \ s ts t -> fmap return . consCheck False s ts t }
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder Record for prover specific functions. This is used by both GUI and command
ccead401e8728af7734715b70ec4f5c34096b683Martin Kühl line interface.
proverHelpText = "http://clarkparsia.com/pellet/\n",
Implementation of 'Logic.Prover.proveCMDLautomatic' which provides an
-> IO (Result.Result ([ProofStatus ProofTree]))
Implementation of 'Logic.Prover.proveCMDLautomaticBatch' which provides an
createTextSaveDisplay "Pellet prover" ("./"++ dName ++".pellet.log")
Disproved -> createTextSaveDisplay "Pellet prover" (dName ++".pellet.owl")
createTextSaveDisplay "Pellet prover" ("./"++ dName ++".pellet.log")
createTextSaveDisplay "Pellet prover" ("./"++ dName ++".pellet.log")
let command = "sh pellet.sh "
progTh <- doesFileExist $ pPath ++ "/pellet.sh"
progPerms <- getPermissions $ pPath ++ "/pellet.sh"
(writeFile (saveFileName ++".entail.owl") entail)
"-" ++ (show $ utctDayTime t) ++ ".entails.owl"
let command = "sh pellet.sh " ++ extraOptions ++ " " ++ entailsFile