Changeset 12736

Show
Ignore:
Timestamp:
27.10.2009 10:37:15 (4 weeks ago)
Author:
codruta
Message:

Fixed the warnings in ExtModal?

Location:
trunk/ExtModal
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/ExtModal/ExtModalSign.hs

    r12732 r12736  
    1616 
    1717import Common.Id 
    18 import Common.DocUtils 
    19 import Common.Doc 
    2018 
    2119import qualified Data.Map as Map 
  • trunk/ExtModal/MorphismExtension.hs

    r12732 r12736  
    1414import qualified Data.Set as Set 
    1515 
    16 import CASL.Sign 
    1716import CASL.Morphism 
    1817import Common.Id 
    19 import Common.Result 
    20 import Common.DocUtils 
    21 import Common.Doc 
    2218 
    23 import ExtModal.AS_ExtModal 
    2419import ExtModal.ExtModalSign 
    25 import ExtModal.Print_AS 
    2620 
    2721data MorphExtension = MorphExtension 
     
    3630 
    3731 
    38 instance Pretty MorphExtension where  
    39         pretty me = pretty (source me) <+> pretty (target me) <+>  
    40                         text (show (Map.toList (mod_map me))) <+> text (show (Map.toList (nom_map me))) 
    41  
    4232instance MorphismExtension EModalSign MorphExtension where  
    4333  
     
    4838                        (foldl insert_next Map.empty (Set.toList (nominals sgn))) 
    4939 
    50         composeMorphismExtension sgn me1 me2 =  
     40        composeMorphismExtension _ me1 me2 =  
    5141                if me1 == me2  
    5242                   then let me_compos second_map  old_map (me_k, me_val) =  
     
    6050        inverseMorphismExtension me =  
    6151                let swap_arrows old_map (me_k, me_val) = Map.insert me_val me_k old_map 
    62                     occurs_alt [] once me_val = once 
    63                     occurs_alt ((me_k,me_val1):l) True me_val2 =  
     52                    occurs_alt [] once _ = once 
     53                    occurs_alt ((_,me_val1):l) True me_val2 =  
    6454                        if me_val1 == me_val2 then True else occurs_alt l True me_val2 
    65                     occurs_alt ((me_k,me_val1):l) False me_val2 =  
     55                    occurs_alt ((_,me_val1):l) False me_val2 =  
    6656                        if me_val1 == me_val2 then occurs_alt l True me_val2 else occurs_alt l False me_val2 
    6757                in if Map.keys (modalities (target me)) == Map.elems (mod_map me)  
  • trunk/ExtModal/Parse_AS.hs

    r12732 r12736  
    4848           modal <- parseModality 
    4949           close <- cBracketT 
    50            grading <- asKey lessEq 
    51            number <- getNumber 
    52            formula <- primFormula ext_modal_reserved_words 
    53            return (BoxOrDiamond True modal True (value 10 number) formula $ toRange open [] close) 
     50           asKey lessEq 
     51           number <- getNumber 
     52           em_formula <- primFormula ext_modal_reserved_words 
     53           return (BoxOrDiamond True modal True (value 10 number) em_formula $ toRange open [] close) 
    5454        <|> 
    5555        {-box, >=-} 
     
    5757           modal <- parseModality 
    5858           close <- cBracketT 
    59            grading <- asKey greaterEq 
    60            number <- getNumber 
    61            formula <- primFormula ext_modal_reserved_words 
    62            return (BoxOrDiamond True modal False (value 10 number) formula $ toRange open [] close) 
     59           asKey greaterEq 
     60           number <- getNumber 
     61           em_formula <- primFormula ext_modal_reserved_words 
     62           return (BoxOrDiamond True modal False (value 10 number) em_formula $ toRange open [] close) 
    6363        <|> 
    6464        {-diamond, <=-} 
     
    6666           modal <- parseModality  
    6767           close <- asKey greaterS 
    68            grading <- asKey lessEq 
    69            number <- getNumber 
    70            formula <- primFormula ext_modal_reserved_words 
    71            return (BoxOrDiamond False modal True (value 10 number) formula $ toRange open [] close) 
     68           asKey lessEq 
     69           number <- getNumber 
     70           em_formula <- primFormula ext_modal_reserved_words 
     71           return (BoxOrDiamond False modal True (value 10 number) em_formula $ toRange open [] close) 
    7272        <|> 
    7373        {-diamond, >=-} 
     
    7575           modal <- parseModality  
    7676           close <- asKey greaterS 
    77            grading <- asKey greaterEq 
    78            number <- getNumber 
    79            formula <- primFormula ext_modal_reserved_words 
    80            return (BoxOrDiamond False modal False (value 10 number) formula $ toRange open [] close) 
     77           asKey greaterEq 
     78           number <- getNumber 
     79           em_formula <- primFormula ext_modal_reserved_words 
     80           return (BoxOrDiamond False modal False (value 10 number) em_formula $ toRange open [] close) 
    8181        <|> 
    8282        {-empty diamond, <=-} 
    8383        do diam <- asKey diamondS 
    84            grading <- asKey lessEq 
    85            number <- getNumber 
    86            formula <- primFormula ext_modal_reserved_words 
     84           asKey lessEq 
     85           number <- getNumber 
     86           em_formula <- primFormula ext_modal_reserved_words 
    8787           let pos = tokPos diam 
    88            return (BoxOrDiamond False (Simple_modality $ Token emptyS pos) True (value 10 number) formula pos) 
     88           return (BoxOrDiamond False (Simple_modality $ Token emptyS pos) True (value 10 number) em_formula pos) 
    8989        <|> 
    9090        {-empty diamond, >=-} 
    9191        do diam <- asKey diamondS 
    92            grading <- asKey greaterEq 
    93            number <- getNumber 
    94            formula <- primFormula ext_modal_reserved_words 
     92           asKey greaterEq 
     93           number <- getNumber 
     94           em_formula <- primFormula ext_modal_reserved_words 
    9595           let pos = tokPos diam 
    96            return (BoxOrDiamond False (Simple_modality $ Token emptyS pos) False (value 10 number) formula pos) 
     96           return (BoxOrDiamond False (Simple_modality $ Token emptyS pos) False (value 10 number) em_formula pos) 
    9797        <|> 
    9898        {-Until, U-} 
     
    112112        {-All paths, A-} 
    113113        do ap <- asKey allPathsS 
    114            formula <- primFormula ext_modal_reserved_words 
     114           em_formula <- primFormula ext_modal_reserved_words 
    115115           let pos = tokPos ap 
    116            return (PathQuantification True formula pos) 
     116           return (PathQuantification True em_formula pos) 
    117117        <|> 
    118118        {-Some paths, E-} 
    119119        do sp <- asKey somePathsS 
    120            formula <- primFormula ext_modal_reserved_words 
     120           em_formula <- primFormula ext_modal_reserved_words 
    121121           let pos = tokPos sp 
    122            return (PathQuantification False formula pos) 
     122           return (PathQuantification False em_formula pos) 
    123123        <|> 
    124124        {-Next, X-} 
    125125        do nxt <- asKey nextS 
    126            formula <- primFormula ext_modal_reserved_words 
     126           em_formula <- primFormula ext_modal_reserved_words 
    127127           let pos = tokPos nxt 
    128            return (NextY True formula pos) 
     128           return (NextY True em_formula pos) 
    129129        <|> 
    130130        {-Yesterday, Y-} 
    131131        do ysd <- asKey yesterdayS 
    132            formula <- primFormula ext_modal_reserved_words 
     132           em_formula <- primFormula ext_modal_reserved_words 
    133133           let pos = tokPos ysd 
    134            return (NextY False formula pos) 
     134           return (NextY False em_formula pos) 
    135135        <|> 
    136136        {-Generally, G-} 
    137137        do grl <- asKey generallyS 
    138            formula <- primFormula ext_modal_reserved_words 
     138           em_formula <- primFormula ext_modal_reserved_words 
    139139           let pos = tokPos grl 
    140            return (StateQuantification True True formula pos) 
     140           return (StateQuantification True True em_formula pos) 
    141141        <|> 
    142142        {-Eventually, F-} 
    143143        do evt <- asKey eventuallyS 
    144            formula <- primFormula ext_modal_reserved_words 
     144           em_formula <- primFormula ext_modal_reserved_words 
    145145           let pos = tokPos evt 
    146            return (StateQuantification True False formula pos) 
     146           return (StateQuantification True False em_formula pos) 
    147147        <|> 
    148148        {-Hitherto, H-} 
    149149        do hth <- asKey hithertoS 
    150            formula <- primFormula ext_modal_reserved_words 
     150           em_formula <- primFormula ext_modal_reserved_words 
    151151           let pos = tokPos hth 
    152            return (StateQuantification False True formula pos) 
     152           return (StateQuantification False True em_formula pos) 
    153153        <|> 
    154154        {-Previously, P-} 
    155155        do prv <- asKey previouslyS 
    156            formula <- primFormula ext_modal_reserved_words 
     156           em_formula <- primFormula ext_modal_reserved_words 
    157157           let pos = tokPos prv 
    158            return (StateQuantification False False formula pos) 
     158           return (StateQuantification False False em_formula pos) 
    159159        <|> 
    160160        {-parse Mu-} 
    161161        do mu <- asKey muS 
    162162           z <- varId ext_modal_reserved_words 
    163            formula <- primFormula ext_modal_reserved_words 
     163           em_formula <- primFormula ext_modal_reserved_words 
    164164           let pos = tokPos mu 
    165            return (FixedPoint True z formula pos) 
     165           return (FixedPoint True z em_formula pos) 
    166166        <|>      
    167167        {-parse Nu-} 
    168168        do nu <- asKey nuS 
    169169           z <- varId ext_modal_reserved_words 
    170            formula <- primFormula ext_modal_reserved_words 
     170           em_formula <- primFormula ext_modal_reserved_words 
    171171           let pos = tokPos nu 
    172            return (FixedPoint False z formula pos) 
     172           return (FixedPoint False z em_formula pos) 
    173173        <|> 
    174174        {-@-} 
    175175        do at <- asKey atS 
    176176           nom <- simpleId 
    177            formula <- primFormula ext_modal_reserved_words 
     177           em_formula <- primFormula ext_modal_reserved_words 
    178178           let pos = tokPos at 
    179            return (Hybrid True (Nominal nom) formula pos) 
     179           return (Hybrid True (Nominal nom) em_formula pos) 
    180180        <|> 
    181181        {-Here-} 
    182182        do her <- asKey hereS 
    183183           nom <- simpleId 
    184            formula <- primFormula ext_modal_reserved_words 
     184           em_formula <- primFormula ext_modal_reserved_words 
    185185           let pos = tokPos her 
    186            return (Hybrid False (Nominal nom) formula pos) 
     186           return (Hybrid False (Nominal nom) em_formula pos) 
    187187         
    188188 
     
    193193           return (Simple_modality t) 
    194194        <|> 
    195         do opn <- asKey tmOParanthS 
     195        do asKey tmOParanthS 
    196196           t <- parseModality  
    197            cls <- asKey tmCParanthS 
     197           asKey tmCParanthS 
    198198           return t 
    199199        <|> 
    200200        do f <- primFormula ext_modal_reserved_words 
    201            grd <- asKey tmGuardS 
     201           asKey tmGuardS 
    202202           return (Guard f) 
    203203        <|> 
    204204        do t <- parseModality  
    205            tc <- asKey tmTransClosS 
     205           asKey tmTransClosS 
    206206           return (TransitiveClosure t) 
    207207        <|> 
    208208        do t1 <- parseModality 
    209            cmp <- asKey tmCompositionS 
     209           asKey tmCompositionS 
    210210           t2 <- parseModality 
    211211           return (Composition t1 t2) 
    212212        <|> 
    213213        do t1 <- parseModality 
    214            un <- asKey tmUnionS 
     214           asKey tmUnionS 
    215215           t2 <- parseModality 
    216216           return (Union t1 t2) 
     
    249249           parseAxioms False annoId ( catRange $ k : ks ) 
    250250        <|> 
    251         do tmp <- asKey timeS 
     251        do asKey timeS 
    252252           k <- mKey  
    253253           (annoId, ks) <- separatedBy (annoParser simpleId) anComma 
  • trunk/ExtModal/Print_AS.hs

    r12645 r12736  
    1313module ExtModal.Print_AS where 
    1414 
    15 import Common.Id 
    1615import Common.Keywords 
    1716import qualified Data.Map as Map 
     
    2423import ExtModal.ExtModalSign 
    2524import ExtModal.Keywords 
     25import ExtModal.MorphismExtension 
    2626 
    2727import CASL.AS_Basic_CASL (FORMULA(..)) 
     
    6262 
    6363instance Pretty EM_FORMULA where  
    64         pretty (BoxOrDiamond choice modality leq_geq number sentence _) =  
     64        pretty (BoxOrDiamond choice modality leq_geq number em_sentence _) =  
    6565                let sp = case modality of  
    6666                                Simple_modality _ -> (<>) 
     
    6969                in sep $ (if choice then brackets mdl else less `sp` mdl `sp` greater) 
    7070                       : (if leq_geq then keyword lessEq else keyword greaterEq) 
    71                        : (text (show number)) : space : [condParensInnerF (printFormula pretty) parens sentence] 
     71                       : (text (show number)) : space : [condParensInnerF (printFormula pretty) parens em_sentence] 
    7272 
    73         pretty (Hybrid choice nom sentence _) =  
     73        pretty (Hybrid choice nom em_sentence _) =  
    7474                sep $ (if choice then keyword atS else keyword hereS) : space : (pretty nom) : space 
    75                     : [condParensInnerF (printFormula pretty) parens sentence] 
     75                    : [condParensInnerF (printFormula pretty) parens em_sentence] 
    7676        pretty (UntilSince choice sentence1 sentence2 _) =  
    7777                sep $ ([condParensInnerF (printFormula pretty) parens sentence1] 
    7878                       ++ ( space : (if choice then keyword untilS else keyword sinceS) : space  
    7979                             : [condParensInnerF (printFormula pretty) parens sentence2])) 
    80         pretty (PathQuantification choice sentence _) =  
     80        pretty (PathQuantification choice em_sentence _) =  
    8181                sep $ (if choice then keyword allPathsS else keyword somePathsS) : space 
    82                     : [condParensInnerF (printFormula pretty) parens sentence] 
    83         pretty (NextY choice sentence _) =  
     82                    : [condParensInnerF (printFormula pretty) parens em_sentence] 
     83        pretty (NextY choice em_sentence _) =  
    8484                sep $ (if choice then keyword nextS else keyword yesterdayS) : space 
    85                     : [condParensInnerF (printFormula pretty) parens sentence] 
    86         pretty (StateQuantification dir_choice choice sentence _) =  
     85                    : [condParensInnerF (printFormula pretty) parens em_sentence] 
     86        pretty (StateQuantification dir_choice choice em_sentence _) =  
    8787                let kw = case dir_choice of  
    8888                                True -> if choice then keyword generallyS else keyword eventuallyS 
    8989                                _ -> if choice then keyword hithertoS else keyword previouslyS 
    90                 in sep $ kw : space : [condParensInnerF (printFormula pretty) parens sentence] 
     90                in sep $ kw : space : [condParensInnerF (printFormula pretty) parens em_sentence] 
     91        pretty (FixedPoint choice p_var em_sentence _) =  
     92                sep $ (if choice then keyword muS else keyword nuS) : space : (pretty p_var) : space 
     93                        : [condParensInnerF (printFormula pretty) parens em_sentence] 
    9194         
    9295condParensInnerF :: Pretty f => (FORMULA f -> Doc) -> (Doc -> Doc) -> FORMULA f -> Doc 
     
    132135        vcat . map (\ tf -> fsep $ punctuate semi $ map (printAnnoted $ pretty . sim) tf) 
    133136 
     137instance Pretty MorphExtension where  
     138        pretty me = pretty (source me) <+> pretty (target me) <+>  
     139                        text (show (Map.toList (mod_map me))) <+> text (show (Map.toList (nom_map me))) 
     140 
  • trunk/ExtModal/StatAna.hs

    r12674 r12736  
    4343        freeVarsOfExt sign ( StateQuantification _ _ f _ ) = freeVars sign f 
    4444        freeVarsOfExt sign ( NextY _ f _ ) = freeVars sign f 
    45         freeVarsOfExt sign ( FixedPoint _ fpvar f _ ) = freeVars sign f 
     45        freeVarsOfExt sign ( FixedPoint _ _ f _ ) = freeVars sign f 
    4646 
    4747basicEModalAnalysis  
     
    6868                        Union md1 md2 -> do new_md1 <- checkMod md1 
    6969                                            new_md2 <- checkMod md2 
    70                                             return $ Union md1 md2 
     70                                            return $ Union new_md1 new_md2 
    7171                        TransitiveClosure md -> do new_md <- checkMod md 
    7272                                                   return $ TransitiveClosure new_md