CASL2OWL.hs revision 72204f862232e7e51b0207bba020c1d781fa7798
0N/ALicense : GPLv2 or higher, see LICENSE.txt
0N/APortability : non-portable (via Logic.Logic)
0N/Amodule OWL2.CASL2OWL where
0N/Aimport Logic.Logic as Logic
0N/Aimport Logic.Comorphism
2362N/Aimport Common.AS_Annotation
2362N/Aimport Common.DocUtils
2362N/Aimport Common.Result
4169N/Aimport Common.ProofTree
0N/Aimport Common.ProofUtils
0N/Aimport qualified Common.Lib.MapSet as MapSet
1178N/Aimport OWL2.Logic_OWL2
1178N/Aimport OWL2.ManchesterPrint ()
4033N/Aimport OWL2.Morphism
1178N/Aimport OWL2.Symbols
1178N/Aimport CASL.Logic_CASL
4033N/Aimport CASL.AS_Basic_CASL
1178N/Aimport CASL.Disambiguate
4033N/Aimport qualified CASL.MapSentence as MapSen
1178N/Aimport CASL.Morphism
1178N/Aimport CASL.SimplifySen
4033N/Aimport CASL.Sublogic
1178N/Aimport CASL.ToDoc
1178N/Aimport CASL.Overload
4033N/AmapMorphism _ = fail "CASL2OWL.mapMorphism"
0N/A{- names must be disambiguated as is done in CASL.Qualify or SuleCFOL2SoftFOL.
4033N/A nsorts = Set.difference ss esorts
0N/A let (m, r) = Set.deleteFindMin s
4033N/A ) (Set.toList r) ++ disjSorts r
4033N/A nonEmptySens = map (\ s -> mkIndi True s [s]) $ Set.toList nsorts
0N/A (cs, ncs) = MapSet.partition (null . opArgs) om
0N/A (sos, os) = MapSet.partition isSingleArgOp ncs
0N/A (sps, rps) = MapSet.partition (isSingle . predArgs) pm
1178N/A (bps, ps) = MapSet.partition isBinPredType rps
0N/A osig = OS.emptySign
0N/A $ MapSet.keysSet bps
4033N/A , individuals = toIris $ MapSet.keysSet cs
0N/A s1 <- Map.foldWithKey (\ i s ml -> do
4033N/A (keepMinimals csig id $ map opRes $ Set.toList s) : l)
4033N/A (return sortSens) (MapSet.toMap cs)
4033N/A s2 <- Map.foldWithKey (\ i s ml -> do
4033N/A let sl = Set.toList s
4033N/A (as, rs) -> fail $ "CASL2OWL.mapSign2: " ++ show i ++ " args: "
4033N/A (return s1) (MapSet.toMap sos)
4033N/A s3 <- Map.foldWithKey (\ i s ml -> do
1178N/A case map keepMaxs . transpose . map predArgs $ Set.toList s of
0N/A ts -> fail $ "CASL2OWL.mapSign3: " ++ show i ++ " types: " ++ show ts)
0N/A (return s2) (MapSet.toMap bps)
4033N/A s4 <- Map.foldWithKey (\ i s ml ->
4033N/A case keepMaxs $ concatMap predArgs $ Set.toList s of
0N/A ts -> fail $ "CASL2OWL.mapSign4: " ++ show i ++ " types: " ++ show ts)
1178N/A (return s3) (MapSet.toMap sps)
0N/A MapSet.foldWithKey (\ i s m -> m >> mkHint True i s) (return ()) os
0N/A MapSet.foldWithKey (\ i s m -> m >> mkHint False i s) (return ()) ps
ns = map (mapNamed $ MapSen.mapMorphForm (const id) mor) sens