Changeset 12753
- Timestamp:
- 29.10.2009 17:17:25 (3 weeks ago)
- Location:
- trunk
- Files:
-
- 1 modified
- 1 moved
-
Comorphisms/CASL2TopSort.hs (moved) (moved from trunk/Comorphisms/CASL2TopSort.inline.hs) (5 diffs)
-
Makefile (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Comorphisms/CASL2TopSort.hs
r12709 r12753 211 211 (genSenName "o" opName $ length sl) (genOpEquation kind opName) sl spl 212 212 213 mkQualPred :: PRED_NAME -> SORT -> PRED_SYMB 214 mkQualPred symS ts = Qual_pred_name symS (Pred_type [ts] nullRange) nullRange 215 213 216 symmetryAxioms :: SubSortMap -> Rel.Rel SORT -> [Named (FORMULA ())] 214 217 symmetryAxioms ssMap sortRels = … … 216 219 mR = Rel.mostRight sortRels 217 220 symTopSorts = not . Set.null . Set.intersection mR 218 xVar = mkSimpleId "x" 219 updateLabel ts symS [sen] = 220 reName (\ s -> show ts ++ s ++ show symS) sen 221 updateLabel _ _ _ = error "CASL2TopSort.symmetryAxioms" 222 toAxioms symSet = 223 [updateLabel ts symS (inlineAxioms CASL 224 "sort ts pred symS:ts\n\ 225 \forall xVar : ts\n\ 226 \. symS(xVar) %(_symmetric_with_)%") 227 | s <- Set.toList (Set.difference symSet mR), 228 let ts = lkupTop ssMap s, 229 let symS = fromJust (lkupPredName ssMap s)] 230 221 toAxioms symSet = map (\ s -> 222 let ts = lkupTop ssMap s 223 Just symS = lkupPredName ssMap s 224 psy = mkQualPred symS ts 225 vd = mkVarDeclStr "x" ts 226 vt = toQualVar vd 227 in makeNamed (show ts ++ "_symmetric_with_" ++ show symS) 228 $ mkForall [vd] (Predication psy [vt] nullRange) nullRange 229 ) $ Set.toList (Set.difference symSet mR) 231 230 in concatMap toAxioms (filter symTopSorts symSets) 232 231 … … 237 236 -- generate argument restrictions for operations 238 237 axs <- Map.foldWithKey (procOpMapping subSortMap) (return []) oMap 239 return $ reversehi_axs ++ reverse p_axs ++ reverse axs238 return $ hi_axs ++ reverse p_axs ++ reverse axs 240 239 where p_axs = 241 240 -- generate argument restrictions for predicates … … 251 250 -- generate subclass_of axioms derived from subsorts 252 251 -- and non-emptyness axioms 253 Map.fold (\ prdInf al->252 concatMap (\ prdInf -> 254 253 let ts = topSortPI prdInf 255 254 subS = predicatePI prdInf … … 261 260 predicatePI $ Map.lookup s subSortMap) 262 261 $ Set.toList set 263 x = mkSimpleId "x" 264 in al ++ zipWith (\ sen supS -> 265 reName (\ s -> show subS ++ s 266 ++ show supS) sen) 267 (concat [inlineAxioms CASL 268 "sort ts\n\ 269 \pred subS,supS: ts\n\ 270 \ forall x : ts . subS(x) =>\n\ 271 \ supS(x) %(_subclassOf_)%"|supS<-supPreds] 272 ) supPreds ++ 273 map (reName (show subS ++)) 274 (concat [inlineAxioms CASL 275 "sort ts\n\ 276 \pred subS: ts \n\ 277 \. exists x:ts . \n\ 278 \ subS(x) %(_non_empty)%"]) 279 ) [] subSortMap 262 x = mkVarDeclStr "x" ts 263 mkPredf sS = Predication (mkQualPred sS ts) [toQualVar x] 264 nullRange 265 in makeNamed (show subS ++ "_non_empty") 266 (Quantification Existential [x] (mkPredf subS) 267 nullRange) 268 : map (\ supS -> 269 makeNamed (show subS ++ "_subclassOf_" ++ show supS) 270 $ mkForall [x] 271 (mkImpl (mkPredf subS) $ mkPredf supS) 272 nullRange) supPreds 273 ) $ Map.elems subSortMap 280 274 281 275 mkProfMapPred :: SubSortMap -> Set.Set PredType -
trunk/Makefile
r12745 r12753 363 363 364 364 # files to be processed by utils/InlineAxioms 365 inline_axiom_files = \ 366 Comorphisms/Modal2CASL.hs Comorphisms/CASL2TopSort.hs \ 365 inline_axiom_files = Comorphisms/Modal2CASL.hs \ 367 366 Comorphisms/CASL2SubCFOL.hs CASL_DL/PredefinedSign.hs 368 367