SoftFOL2CommonLogic.hs revision e9458b1a7a19a63aa4c179f9ab20f4d50681c168
4751N/ALicense : GPLv2 or higher, see LICENSE.txt
4751N/APortability : non-portable (imports Logic.Logic)
4751N/Aimport Data.Maybe (maybeToList)
4751N/Aimport Common.ProofTree
5061N/Aimport Common.Result
5821N/Aimport Common.Utils (concatMapM)
4751N/Aimport qualified Common.AS_Annotation as AS_Anno
4751N/Aimport qualified Common.DefaultMorphism as DefaultMorphism
4751N/Aimport qualified Common.Lib.Rel as Rel
4751N/Aimport Logic.Logic
4751N/Aimport Logic.Comorphism
4751N/Aimport qualified SoftFOL.Logic_SoftFOL as FOLLogic
4751N/Aimport qualified SoftFOL.Sign as FOLSign
4751N/Aimport qualified CommonLogic.Logic_CommonLogic as ClLogic
4751N/Aimport qualified CommonLogic.Sign as ClSign
4751N/Aimport qualified CommonLogic.Symbol as ClSymbol
4751N/Aimport qualified CommonLogic.Morphism as ClMor
4751N/Aimport qualified CommonLogic.Sublogic as ClSL
4751N/A FOLLogic.SoftFOL -- lid domain
4751N/A [FOLSign.TPTP] -- Basic spec domain
4751N/A FOLSign.Sentence -- sentence domain
4751N/A FOLSign.Sign -- signature domain
4751N/A FOLSign.SoftFOLMorphism -- morphism domain
4751N/A FOLSign.SFSymbol -- symbol domain
4751N/A ClLogic.CommonLogic -- lid domain
4751N/A ClSL.CommonLogicSL -- sublogics codomain
4751N/A ClSign.Sign -- signature domain
4751N/A ClMor.Morphism -- morphism domain
4751N/A ClSymbol.Symbol -- symbol domain
4751N/A ClSymbol.Symbol -- rawsymbol domain
4751N/A sourceLogic SoftFOL2CommonLogic = FOLLogic.SoftFOL
4751N/A targetLogic SoftFOL2CommonLogic = ClLogic.CommonLogic
4751N/AmapSub :: () -> ClSL.CommonLogicSL
4751N/AmapSub _ = ClSL.folsl
4751N/A let src = mapSign $ DefaultMorphism.domOfDefaultMorphism mor
4751N/A tgt = mapSign $ DefaultMorphism.codOfDefaultMorphism mor
4751N/A in return $ ClMor.Morphism src tgt pmp
4751N/A ++ map (uncurry AS_Anno.makeNamed) trans_fs)
4751N/A transSnd :: (String, FOLSign.Sentence) -> Result (String, TEXT_META)
4751N/A fm = funcMapText $ FOLSign.funcMap srcSign
4751N/A pm = predMapText $ FOLSign.predMap srcSign
4751N/A [ map (AS_Anno.makeNamed sortRelTrS) (maybeToList sr)
5821N/A , map (AS_Anno.makeNamed funcMapTrS) (maybeToList fm)
4751N/A , map (AS_Anno.makeNamed predMapTrS) (maybeToList pm)
4751N/A let ps = Map.foldWithKey (\ subSrt set phrs ->
let ps = Map.foldWithKey (\ f set phrs ->
Set.fold (\ (args, res) phrs2 ->
let ps = Map.foldWithKey (\ prd set phrs ->
Set.fold (\ args phrs2 ->
FOLSign.SPQuantTerm qsym vl f -> quantTrm s qsym vl f
FOLSign.SPComplexTerm sym args -> case sym of
FOLSign.SPEqual -> case args of
FOLSign.SPTrue -> return clTrue
FOLSign.SPFalse -> return clFalse
FOLSign.SPOr -> do
FOLSign.SPAnd -> do
FOLSign.SPNot -> case args of
FOLSign.SPImplies -> case args of
FOLSign.SPImplied -> case args of
FOLSign.SPEquiv -> case args of
predicateSPTerms :: TERM -> [FOLSign.SPTerm] -> Result SENTENCE
in order to apply functions/predicates s, t and u to them (defined in
FOLSign.SPForall -> return Universal
FOLSign.SPExists -> return Existential
FOLSign.SPComplexTerm _ [] ->
FOLSign.SPComplexTerm sym args -> typeSentenceGetTypes sig (symToName sym) args
FOLSign.SPQuantTerm {} ->
Just ts -> typeSentencesDisjPred sig args $ Set.elems ts
Just ts -> typeSentencesDisjFunc sig args $ Set.elems ts
-> [[FOLSign.SPIdentifier]]
where tsdp1 :: [FOLSign.SPIdentifier] -> Result SENTENCE
FOLSign.SPComplexTerm _ [] ->
FOLSign.SPComplexTerm _ _ ->
FOLSign.SPQuantTerm {} ->
FOLSign.SPComplexTerm _ [] ->
FOLSign.SPComplexTerm _ _ -> do
FOLSign.SPQuantTerm {} ->
trmToName :: FOLSign.SPTerm -> NAME
FOLSign.SPComplexTerm sym _ -> symToName sym
trmToNameSeq :: FOLSign.SPTerm -> [NAME_OR_SEQMARK]
FOLSign.SPComplexTerm sym [] -> [Name $ symToName sym]
FOLSign.SPComplexTerm _ args -> concatMap trmToNameSeq args
FOLSign.SPQuantTerm {} ->
-- converts an SPTerm to a TERM, i.e. for the arguments of an equation
trmToTerm :: FOLSign.SPTerm -> Result TERM
FOLSign.SPQuantTerm {} -> fail "quantification not allowed for a term"
FOLSign.SPComplexTerm _ [] -> return $ Name_term $ trmToName t
FOLSign.SPComplexTerm _ _ -> trmToFunctTrm t
trmToTermSeq :: FOLSign.SPTerm -> Result TERM_SEQ
FOLSign.SPComplexTerm _ _ -> do
FOLSign.SPQuantTerm {} ->
trmToFunctTrm :: FOLSign.SPTerm -> Result TERM
FOLSign.SPComplexTerm sym args ->
FOLSign.SPQuantTerm {} ->
symToName :: FOLSign.SPSymbol -> NAME
FOLSign.SPCustomSymbol i -> i
FOLSign.SPID -> idName
FOLSign.SPDiv -> divName
FOLSign.SPComp -> compName
FOLSign.SPSum -> sumName
FOLSign.SPConv -> convName
symToTerm :: FOLSign.SPSymbol -> TERM
isNullary :: FOLSign.SPTerm -> Bool
FOLSign.SPComplexTerm _ [] -> True