Changeset 12794
- Timestamp:
- 06.11.2009 18:39:28 (2 weeks ago)
- Location:
- trunk
- Files:
-
- 2 modified
-
Comorphisms/CASL2TopSort.hs (modified) (9 diffs)
-
utils/nightly/cronjob.sh (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Comorphisms/CASL2TopSort.hs
r12793 r12794 10 10 Coding out subsorting into unary predicates. 11 11 New concept for proving Ontologies. 12 13 generatedness via non-injective datatype constructors 14 (i.e. proper data constructors) is simply ignored 12 15 -} 13 16 … … 56 59 Symbol RawSymbol ProofTree where 57 60 sourceLogic CASL2TopSort = CASL 58 sourceSublogic CASL2TopSort = SL. top61 sourceSublogic CASL2TopSort = SL.caslTop 59 62 { sub_features = LocFilSub 60 , which_logic = FOL 61 , cons_features = SortGen 62 { emptyMapping = True 63 , onlyInjConstrs = True }} 63 , cons_features = emptyMapConsFeature } 64 64 targetLogic CASL2TopSort = CASL 65 65 mapSublogic CASL2TopSort sub = … … 145 145 146 146 transSig :: Sign () e -> Result (Sign () e, [Named (FORMULA ())]) 147 transSig sig = if Rel.null sortRels then 148 hint (sig, []) 149 "CASL2TopSort.transSig: Signature is unchanged (no subsorting present)" 150 nullRange 147 transSig sig = if Rel.null sortRels then return (sig, []) 151 148 else do 152 149 subSortMap <- generateSubSortMap sortRels (predMap sig) 153 let (dias2, newPredMap) = Map.mapAccum (\ ds (un, ds1) -> (ds ++ ds1, un)) 154 [] $ Map.unionWithKey repError (transPredMap subSortMap 150 let newPredMap = Map.unionWith Set.union (transPredMap subSortMap 155 151 $ predMap sig) $ newPreds subSortMap 156 Result dias2 $ Just ()157 152 axs <- generateAxioms subSortMap (predMap sig) (opMap sig) 158 153 return (sig … … 165 160 }, axs ++ symmetryAxioms subSortMap sortRels) 166 161 where sortRels = Rel.transClosure $ sortRel sig 167 repError k (v1, d1) (v2, d2) =168 (Set.union v1 v2,169 Diag Warning170 ("CASL2TopSort.transSig: generating " ++171 "overloading: Predicate " ++ show k ++172 " gets additional type(s): " ++ show v2) nullRange173 : d1 ++ d2 )174 162 newPreds = 175 163 foldr (\ pI -> Map.insert (predicatePI pI) 176 164 (Set.singleton 177 (PredType [topSortPI pI]) ,[]))165 (PredType [topSortPI pI]))) 178 166 Map.empty . Map.elems 179 167 180 168 transPredMap :: SubSortMap -> Map.Map PRED_NAME (Set.Set PredType) 181 -> Map.Map PRED_NAME (Set.Set PredType , [Diagnosis])182 transPredMap subSortMap = Map.map (\ s -> (Set.map transType s, []))169 -> Map.Map PRED_NAME (Set.Set PredType) 170 transPredMap subSortMap = Map.map $ Set.map transType 183 171 where transType t = t 184 172 { predArgs = map (\ s -> maybe s topSortPI … … 217 205 symmetryAxioms ssMap sortRels = 218 206 let symSets = Rel.sccOfClosure sortRels 219 toAxioms symSet= concatMap207 toAxioms = concatMap 220 208 (\ s -> 221 209 let ts = lkupTop ssMap s … … 227 215 [makeNamed (show ts ++ "_symmetric_with_" ++ show symS) 228 216 $ mkForall [vd] (Predication psy [vt] nullRange) nullRange] 229 ) $ Set.toList symSet217 ) . Set.toList 230 218 in concatMap toAxioms symSets 231 219 … … 292 280 where joinedList = opArgs ot ++ [opRes ot] 293 281 fKind = opKind ot 294 dias' = [ Diag Warning 295 ("Please, check if operation \"" ++ 296 show opName ++ 297 "\" is still partial as intended,\ 298 \ since a joining of types could\ 299 \ have made it total!!") 300 nullRange 282 dias' = [ mkDiag Hint "partial op" opName 301 283 | fKind == Partial ] 302 284 pt2topSorts = map (lkupTop ssm) … … 385 367 transSen :: (Show f) => Sign f e -> FORMULA f -> Result (FORMULA f) 386 368 transSen sig f = let sortRels = Rel.transClosure $ sortRel sig in 387 if Rel.null sortRels then 388 Result [Diag Hint 389 "CASL2TopSort.transSen: Sentence is unchanged (no subsorting present)" 390 nullRange ] (Just f) 369 if Rel.null sortRels then return f 391 370 else do 392 371 ssm <- generateSubSortMap sortRels (predMap sig) … … 489 468 $ conjunct $ map genImpl groupedInjOps 490 469 _ -> error "CASL2TopSort.genEitherAxiom.groupedInjOps" 491 else Result [Diag Error 492 "CASL2TopSort: Cannot handle \ 493 \datatype constructors; only subsort \ 494 \embeddings are allowed with free and \ 495 \generated types!" nullRange] Nothing 470 else Result [mkDiag Warning 471 "ignoring generating constructors" 472 constrs] 473 $ Just $ True_atom nullRange 496 474 isInjOp ops = 497 475 case ops of -
trunk/utils/nightly/cronjob.sh
r12666 r12794 296 296 } 297 297 298 topSortCheck () 299 { 300 cd $HETS_LIB 301 date 302 \rm Basic/*.th 303 \rm Basic/*.thy 304 for i in Basic/*.casl; 305 do ./hets -v2 -o th,thy -t CASL2PCFOLTopSort $i; done 306 date 307 for i in Basic/*.th; do ./hets -v2 -o th,pp.het $i; done 308 date 309 ../Hets/utils/nightly/runisabelle.sh Basic/*.thy > ../isa3.log 2>&1 310 fgrep \*\*\* ../isa3.log 311 } 312 298 313 checkEnvs () 299 314 {