1178N/AMaintainer : codruta.liliana@gmail.com
1178N/Aprinting AS_ExtModal ExtModalSign data types
1178N/Ainstance Pretty EM_BASIC_ITEM where
1178N/A pretty (Simple_mod_decl time id_list ax_list _) =
1178N/A cat[if time then (keyword timeS) else empty
4033N/A , keyword modalityS <+> semiAnnos pretty id_list
1178N/A , space <> specBraces (semiAnnos pretty ax_list)]
1178N/A pretty (Nominal_decl id_list _) = keyword nominalS <+> semiAnnos pretty id_list
1178N/Ainstance Pretty MODALITY where
1178N/A pretty (Simple_modality idt) = pretty idt
1178N/A pretty (Composition md1 md2) = (keyword tmOParanthS) <> (pretty md1) <>
4033N/A (keyword tmCompositionS) <> (pretty md2)
1178N/A pretty (Union md1 md2) = (keyword tmOParanthS) <> (pretty md1) <> (keyword tmUnionS)
4033N/A <> (pretty md2) <> (keyword tmCParanthS)
1178N/A pretty (TransitiveClosure md) = (keyword tmOParanthS) <> (pretty md) <>
1178N/A (keyword (tmTransClosS ++ tmCParanthS))
4033N/A pretty (Guard sen) = (keyword tmOParanthS) <> (pretty sen) <> (keyword (tmGuardS ++ tmCParanthS))
4033N/A pretty Rigid = keyword rigidS
0N/A pretty Flexible = keyword flexibleS
1178N/Ainstance Pretty EM_SIG_ITEM where
1178N/A pretty (Rigid_op_items rig op_list _) =
4033N/A cat [pretty rig <+> keyword (opS ++ pluralS op_list),
1178N/A space <> semiAnnos pretty op_list]
1178N/A pretty (Rigid_pred_items rig pred_list _) =
1178N/A cat [pretty rig <+> keyword (predS ++ pluralS pred_list),
1178N/A space <> semiAnnos pretty pred_list]
1178N/Ainstance Pretty NOMINAL where
1178N/A pretty (Nominal idt) = pretty idt
1178N/Ainstance Pretty EM_FORMULA where
1178N/A pretty (BoxOrDiamond choice modality leq_geq number em_sentence _) =
1178N/A in sep $ (if choice then brackets mdl else less `sp` mdl `sp` greater)
1178N/A : (if leq_geq then keyword lessEq else keyword greaterEq)
4033N/A : (text (show number)) : space : [condParensInnerF (printFormula pretty) parens em_sentence]
1178N/A pretty (Hybrid choice nom em_sentence _) =
1178N/A sep $ (if choice then keyword atS else keyword hereS) : space : (pretty nom) : space
1178N/A : [condParensInnerF (printFormula pretty) parens em_sentence]
4033N/A pretty (UntilSince choice sentence1 sentence2 _) =
1178N/A sep $ ([condParensInnerF (printFormula pretty) parens sentence1]
1178N/A ++ ( space : (if choice then keyword untilS else keyword sinceS) : space
1178N/A : [condParensInnerF (printFormula pretty) parens sentence2]))
1178N/A pretty (PathQuantification choice em_sentence _) =
1178N/A sep $ (if choice then keyword allPathsS else keyword somePathsS) : space
1178N/A : [condParensInnerF (printFormula pretty) parens em_sentence]
4033N/A pretty (NextY choice em_sentence _) =
1178N/A sep $ (if choice then keyword nextS else keyword yesterdayS) : space
1178N/A : [condParensInnerF (printFormula pretty) parens em_sentence]
1178N/A pretty (StateQuantification dir_choice choice em_sentence _) =
4033N/A let kw = case dir_choice of
1178N/A True -> if choice then keyword generallyS else keyword eventuallyS
1178N/A _ -> if choice then keyword hithertoS else keyword previouslyS
1178N/A in sep $ kw : space : [condParensInnerF (printFormula pretty) parens em_sentence]
4033N/A pretty (FixedPoint choice p_var em_sentence _) =
1178N/A sep $ (if choice then keyword muS else keyword nuS) : space : (pretty p_var) : space
1178N/A : [condParensInnerF (printFormula pretty) parens em_sentence]
4033N/AcondParensInnerF :: Pretty f => (FORMULA f -> Doc) -> (Doc -> Doc) -> FORMULA f -> Doc
1178N/AcondParensInnerF frm_print parens_fun frm =
1178N/A Quantification _ _ _ _ -> frm'
0N/A Existl_equation _ _ _ -> frm'
0N/A Strong_equation _ _ _ -> frm'
0N/A Membership _ _ _ -> frm'
0N/A ExtFORMULA _ -> frm'
0N/A _ -> parens_fun frm'
0N/A where frm' = frm_print frm
0N/Ainstance Pretty EModalSign where
0N/A pretty = printEModalSign id
0N/AprintEModalSign :: (FORMULA EM_FORMULA -> FORMULA EM_FORMULA) -> EModalSign -> Doc
0N/AprintEModalSign sim sign =
0N/A printSetMap (keyword rigidS <+> keyword opS) empty (rigidOps sign)
0N/A printSetMap (keyword rigidS <+> keyword predS) empty (rigidPreds sign)
1178N/A cat [keyword modalitiesS <+> (fsep $ punctuate semi $ map sidDoc (
Map.keys mds))
0N/A , specBraces (printFormulaOfEModalSign sim $
Map.elems mds)])
1178N/A keyword timeS <+> keyword modalitiesS <+> (fsep $ punctuate semi $ map sidDoc (
Set.toList tms)))
4033N/AprintFormulaOfEModalSign :: Pretty f => (FORMULA f -> FORMULA f) -> [[Annoted (FORMULA f)]] -> Doc
0N/AprintFormulaOfEModalSign sim =
0N/A vcat . map (\ tf -> fsep $ punctuate semi $ map (printAnnoted $ pretty . sim) tf)
0N/Ainstance Pretty MorphExtension where
1178N/A pretty me = pretty (source me) <+> pretty (target me) <+>