Changeset 12793

Show
Ignore:
Timestamp:
06.11.2009 16:57:28 (2 weeks ago)
Author:
maeder
Message:

corrected symmetry axioms

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/Comorphisms/CASL2TopSort.hs

    r12770 r12793  
    217217symmetryAxioms ssMap sortRels = 
    218218    let symSets = Rel.sccOfClosure sortRels 
    219         mR = Rel.mostRight sortRels 
    220         symTopSorts = not . Set.null . Set.intersection mR 
    221         toAxioms symSet = map (\ s -> 
     219        toAxioms symSet = concatMap 
     220          (\ s -> 
    222221            let ts = lkupTop ssMap s 
    223222                Just symS = lkupPredName ssMap s 
     
    225224                vd = mkVarDeclStr "x" ts 
    226225                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) 
    230     in concatMap toAxioms (filter symTopSorts symSets) 
     226            in if ts == s then [] else 
     227                   [makeNamed (show ts ++ "_symmetric_with_" ++ show symS) 
     228                   $ mkForall [vd] (Predication psy [vt] nullRange) nullRange] 
     229          ) $ Set.toList symSet 
     230    in concatMap toAxioms symSets 
    231231 
    232232generateAxioms :: SubSortMap -> Map.Map PRED_NAME (Set.Set PredType)