Hets - the Heterogeneous Tool Set

Copyright(c) jianchun wang and Uni Bremen 2006
LicenseGPLv2 or higher, see LICENSE.txt
MaintainerChristian.Maeder@dfki.de
Stabilityprovisional
Portabilityportable
Safe HaskellSafe

Common.DocUtils

Contents

Description

Pretty class for pretty printing, some instances and other utility functions

Synopsis

the class stuff

class Show a => Pretty a where Source #

Minimal complete definition

pretty

Methods

pretty :: a -> Doc Source #

pretties :: [a] -> Doc Source #

Instances

Pretty Char Source # 

Methods

pretty :: Char -> Doc Source #

pretties :: [Char] -> Doc Source #

Pretty Int Source # 

Methods

pretty :: Int -> Doc Source #

pretties :: [Int] -> Doc Source #

Pretty Integer Source # 

Methods

pretty :: Integer -> Doc Source #

pretties :: [Integer] -> Doc Source #

Pretty () Source # 

Methods

pretty :: () -> Doc Source #

pretties :: [()] -> Doc Source #

Pretty Id Source # 

Methods

pretty :: Id -> Doc Source #

pretties :: [Id] -> Doc Source #

Pretty Token Source # 
Pretty IRI Source # 

Methods

pretty :: IRI -> Doc Source #

pretties :: [IRI] -> Doc Source #

Pretty Annotation Source # 
Pretty LibName Source # 
Pretty Diagnosis Source # 
Pretty Conservativity Source # 
Pretty Sign Source # 

Methods

pretty :: Sign -> Doc Source #

pretties :: [Sign] -> Doc Source #

Pretty ComorphismDef Source # 
Pretty LogicDef Source # 
Pretty FRAM Source # 

Methods

pretty :: FRAM -> Doc Source #

pretties :: [FRAM] -> Doc Source #

Pretty Sentence Source # 
Pretty Sign Source # 

Methods

pretty :: Sign -> Doc Source #

pretties :: [Sign] -> Doc Source #

Pretty Sign Source # 

Methods

pretty :: Sign -> Doc Source #

pretties :: [Sign] -> Doc Source #

Pretty DEF Source # 

Methods

pretty :: DEF -> Doc Source #

pretties :: [DEF] -> Doc Source #

Pretty EXP Source # 

Methods

pretty :: EXP -> Doc Source #

pretties :: [EXP] -> Doc Source #

Pretty Symbol Source # 
Pretty Morphism Source # 
Pretty MaudeText Source # 
Pretty SymbolKind Source # 
Pretty Symbol Source # 
Pretty Sentence Source # 
Pretty Sign Source # 

Methods

pretty :: Sign -> Doc Source #

pretties :: [Sign] -> Doc Source #

Pretty Morphism Source # 
Pretty OMName Source # 
Pretty Morphism Source # 
Pretty Inclusion Source # 
Pretty Symbol Source # 
Pretty Theory Source # 
Pretty Sign Source # 

Methods

pretty :: Sign -> Doc Source #

pretties :: [Sign] -> Doc Source #

Pretty FORMULA Source # 
Pretty BASIC_SPEC Source # 
Pretty Sign Source # 

Methods

pretty :: Sign -> Doc Source #

pretties :: [Sign] -> Doc Source #

Pretty Morphism Source # 
Pretty Symbol Source # 
Pretty SYMB_ITEMS Source # 
Pretty SYMB_OR_MAP Source # 
Pretty SYMB_MAP_ITEMS Source # 
Pretty NAME_OR_SEQMARK Source # 
Pretty TERM_SEQ Source # 
Pretty TERM Source # 

Methods

pretty :: TERM -> Doc Source #

pretties :: [TERM] -> Doc Source #

Pretty ATOM Source # 

Methods

pretty :: ATOM -> Doc Source #

pretties :: [ATOM] -> Doc Source #

Pretty ImplEq Source # 
Pretty AndOr Source # 
Pretty BOOL_SENT Source # 
Pretty QUANT Source # 
Pretty SENTENCE Source # 
Pretty IMPORTATION Source # 
Pretty MODULE Source # 
Pretty COMMENT Source # 
Pretty PHRASE Source # 
Pretty TEXT Source # 

Methods

pretty :: TEXT -> Doc Source #

pretties :: [TEXT] -> Doc Source #

Pretty TEXT_META Source # 
Pretty BASIC_ITEMS Source # 
Pretty BASIC_SPEC Source # 
Pretty Morphism Source # 
Pretty Symbol Source # 
Pretty SYMB_OR_MAP Source # 
Pretty SYMB_MAP_ITEMS Source # 
Pretty SYMB_ITEMS Source # 
Pretty FORMULA Source # 
Pretty TERM Source # 

Methods

pretty :: TERM -> Doc Source #

pretties :: [TERM] -> Doc Source #

Pretty TYPE Source # 

Methods

pretty :: TYPE -> Doc Source #

pretties :: [TYPE] -> Doc Source #

Pretty BASIC_ITEM Source # 
Pretty BASIC_SPEC Source # 
Pretty Sign Source # 

Methods

pretty :: Sign -> Doc Source #

pretties :: [Sign] -> Doc Source #

Pretty CONTEXT Source # 
Pretty KIND Source # 

Methods

pretty :: KIND -> Doc Source #

pretties :: [KIND] -> Doc Source #

Pretty Symbol Source # 
Pretty Morphism Source # 
Pretty SymbKind Source # 
Pretty SYMB_OR_MAP Source # 
Pretty SYMB_MAP_ITEMS Source # 
Pretty SYMB_ITEMS Source # 
Pretty BASIC_ITEM Source # 
Pretty BASIC_SPEC Source # 
Pretty OWLMorphism Source # 
Pretty SYMB_OR_MAP Source # 
Pretty SYMB_MAP_ITEMS Source # 
Pretty SYMB Source # 

Methods

pretty :: SYMB -> Doc Source #

pretties :: [SYMB] -> Doc Source #

Pretty SYMB_ITEMS Source # 
Pretty FORMULA Source # 
Pretty BASIC_ITEMS Source # 
Pretty BASIC_SPEC Source # 
Pretty PRED_ITEM Source # 
Pretty Morphism Source # 
Pretty Symbol Source # 
Pretty SYMBORMAP Source # 
Pretty SYMBMAPITEMS Source # 
Pretty SYMB Source # 

Methods

pretty :: SYMB -> Doc Source #

pretties :: [SYMB] -> Doc Source #

Pretty SYMBITEMS Source # 
Pretty FORMULA Source # 
Pretty BASICITEMS Source # 
Pretty BASICSPEC Source # 
Pretty PREDITEM Source # 
Pretty Morphism Source # 
Pretty Symbol Source # 
Pretty RDFMorphism Source # 
Pretty RSMorphism Source # 
Pretty RSTMap Source # 
Pretty RSTables Source # 
Pretty RSTable Source # 
Pretty RSColumn Source # 
Pretty RSSymbolKind Source # 
Pretty RSSymbol Source # 
Pretty RSDatatype Source # 
Pretty RSScheme Source # 
Pretty RSRelationships Source # 
Pretty RSRel Source # 
Pretty RSQualId Source # 
Pretty Sen Source # 

Methods

pretty :: Sen -> Doc Source #

pretties :: [Sen] -> Doc Source #

Pretty ConstraintType Source # 
Pretty MultConstr Source # 
Pretty Sign Source # 

Methods

pretty :: Sign -> Doc Source #

pretties :: [Sign] -> Doc Source #

Pretty LinkT Source # 
Pretty PropertyT Source # 
Pretty TypeClass Source # 
Pretty TypeKind Source # 
Pretty Pattern Source # 
Pretty RelationSen Source # 
Pretty Sen Source # 

Methods

pretty :: Sen -> Doc Source #

pretties :: [Sen] -> Doc Source #

Pretty Sign Source # 

Methods

pretty :: Sign -> Doc Source #

pretties :: [Sign] -> Doc Source #

Pretty RuleDef Source # 
Pretty Sign Source # 

Methods

pretty :: Sign -> Doc Source #

pretties :: [Sign] -> Doc Source #

Pretty Morphism Source # 
Pretty Symbol Source # 
Pretty Symbol Source # 
Pretty PredType Source # 
Pretty OpType Source # 
Pretty RawSymbol Source # 
Pretty Component Source # 
Pretty AnnoLiteral Source # 
Pretty AnnoAppl Source # 
Pretty CASL_DLSign Source # 
Pretty CspSen Source # 
Pretty CspSign Source #

Pretty printing for CspCASL signatures

Pretty CspSymbMap Source # 
Pretty CspType Source # 
Pretty CspSymb Source # 
Pretty CspSymbKind Source # 
Pretty CspSymbMapItems Source # 
Pretty CspSymbItems Source # 
Pretty CspRawSymbol Source # 
Pretty CspSymbol Source # 
Pretty CspSymbType Source # 
Pretty CspAddMorphism Source #

a dummy instances used for the default definition

Pretty MorphExtension Source # 
Pretty TermExt Source # 
Pretty FunDef Source # 
Pretty FplOpItem Source # 
Pretty FplSortItem Source # 
Pretty FplExt Source # 
Pretty SignExt Source # 
Pretty Procs Source # 
Pretty Defproc Source # 
Pretty VSEforms Source # 
Pretty VarDecl Source # 
Pretty PlainProgram Source # 
Pretty Procdecls Source # 
Pretty Sigentry Source # 
Pretty Profile Source # 
Pretty Procparam Source # 
Pretty Sen Source # 

Methods

pretty :: Sen -> Doc Source #

pretties :: [Sen] -> Doc Source #

Pretty RawSymbol Source # 
Pretty SymbolKind Source # 
Pretty Symbol Source # 
Pretty Sign Source # 

Methods

pretty :: Sign -> Doc Source #

pretties :: [Sign] -> Doc Source #

Pretty TypedRule Source # 
Pretty Text Source # 

Methods

pretty :: Text -> Doc Source #

pretties :: [Text] -> Doc Source #

Pretty AnyComorphism Source # 
Pretty GMorphism Source # 
Pretty LogicGraph Source # 
Pretty G_morphism Source # 
Pretty G_symb_map_items_list Source # 
Pretty G_symb_items_list Source # 
Pretty G_symbol Source # 
Pretty G_sign Source # 
Pretty G_basic_spec Source # 
Pretty G_theory Source # 
Pretty Text Source # 

Methods

pretty :: Text -> Doc Source #

pretties :: [Text] -> Doc Source #

Pretty a => Pretty [a] Source # 

Methods

pretty :: [a] -> Doc Source #

pretties :: [[a]] -> Doc Source #

Pretty a => Pretty (Maybe a) Source # 

Methods

pretty :: Maybe a -> Doc Source #

pretties :: [Maybe a] -> Doc Source #

Pretty a => Pretty (Set a) Source # 

Methods

pretty :: Set a -> Doc Source #

pretties :: [Set a] -> Doc Source #

Pretty a => Pretty (Annoted a) Source # 

Methods

pretty :: Annoted a -> Doc Source #

pretties :: [Annoted a] -> Doc Source #

Pretty a => Pretty (DefaultMorphism a) Source # 
Pretty a => Pretty (Result a) Source # 

Methods

pretty :: Result a -> Doc Source #

pretties :: [Result a] -> Doc Source #

Pretty a => Pretty (SimpValue a) Source # 
Pretty (DefMorExt e) Source # 
Pretty a => Pretty (Ranged a) Source # 

Methods

pretty :: Ranged a -> Doc Source #

pretties :: [Ranged a] -> Doc Source #

Pretty s => Pretty (S2 s) Source # 

Methods

pretty :: S2 s -> Doc Source #

pretties :: [S2 s] -> Doc Source #

(Pretty a, Pretty b) => Pretty (Either a b) Source # 

Methods

pretty :: Either a b -> Doc Source #

pretties :: [Either a b] -> Doc Source #

(Pretty a, Pretty b) => Pretty (a, b) Source # 

Methods

pretty :: (a, b) -> Doc Source #

pretties :: [(a, b)] -> Doc Source #

(Pretty a, Pretty b) => Pretty (Map a b) Source # 

Methods

pretty :: Map a b -> Doc Source #

pretties :: [Map a b] -> Doc Source #

(Pretty sign, Pretty symbol) => Pretty (ExtSign sign symbol) Source # 

Methods

pretty :: ExtSign sign symbol -> Doc Source #

pretties :: [ExtSign sign symbol] -> Doc Source #

(Show f, Pretty e) => Pretty (Sign f e) Source # 

Methods

pretty :: Sign f e -> Doc Source #

pretties :: [Sign f e] -> Doc Source #

(Pretty a, Pretty b, Pretty c) => Pretty (a, b, c) Source # 

Methods

pretty :: (a, b, c) -> Doc Source #

pretties :: [(a, b, c)] -> Doc Source #

(SignExtension e, Pretty e, Show f, MorphismExtension e m) => Pretty (Morphism f e m) Source # 

Methods

pretty :: Morphism f e m -> Doc Source #

pretties :: [Morphism f e m] -> Doc Source #

(Pretty a, Pretty b, Pretty c, Pretty d) => Pretty (a, b, c, d) Source # 

Methods

pretty :: (a, b, c, d) -> Doc Source #

pretties :: [(a, b, c, d)] -> Doc Source #

sidDoc :: Token -> Doc Source #

convert a token to a document (different from text for LaTex)

printAnnotationList :: [Annotation] -> Doc Source #

print several annotations vertically (each in a new line)

printTrailer :: [Annotation] -> Doc Source #

print annotations flush right

splitAndPrintRAnnos :: Doc -> [Annotation] -> Doc Source #

add trailing annotation to a document

printSemiAnno :: (a -> Doc) -> Bool -> Annoted a -> Doc Source #

conditionally add a semi after the doc but before trailing annotations

startsWithSemanticAnno :: [Annotation] -> Bool Source #

test for semantic annos before structured specs

semiAnnos :: (a -> Doc) -> [Annoted a] -> Doc Source #

print annoted items with trailing semicolons except for the last item

printAnnoted :: (a -> Doc) -> Annoted a -> Doc Source #

print sentence with label and non-axioms with implied annotation

fromLabelledSen :: Named s -> Annoted s Source #

convert a named sentence into an annoted one

splitRAnnos :: [Annotation] -> ([Annotation], [Annotation]) Source #

function to split the annotation to the right of an item. * fst contains printed label and implied annotion if any at the begining of the list of annotations * snd contains the remaining annos

useGlobalAnnos :: GlobalAnnos -> Doc -> Doc Source #

add global annotations for proper mixfix printing

prepPunctuate :: Doc -> [Doc] -> [Doc] Source #

like punctuate but prepends the symbol to all tail elements

printEither :: (a -> Doc) -> (b -> Doc) -> Either a b -> Doc Source #

printMaybe :: (a -> Doc) -> Maybe a -> Doc Source #

ppWithCommas :: Pretty a => [a] -> Doc Source #

printPair :: (a -> Doc) -> (b -> Doc) -> (a, b) -> Doc Source #

printTriple :: (a -> Doc) -> (b -> Doc) -> (c -> Doc) -> (a, b, c) -> Doc Source #

data CSize Source #

container size

Constructors

CEmpty 
CSingle 
CMult 

ppList :: (a -> Doc) -> (CSize -> Doc -> Doc) -> ([Doc] -> Doc) -> [a] -> Doc Source #

ppSet :: (a -> Doc) -> (CSize -> Doc -> Doc) -> ([Doc] -> Doc) -> Set a -> Doc Source #

printSet :: Pretty a => (Doc -> Doc) -> ([Doc] -> Doc) -> Set a -> Doc Source #

printSetMap :: (Pretty k, Pretty a) => Doc -> Doc -> Map k (Set a) -> Doc Source #

printMap :: (Pretty a, Pretty b) => (Doc -> Doc) -> ([Doc] -> Doc) -> (Doc -> Doc -> Doc) -> Map a b -> Doc Source #

ppMap :: (a -> Doc) -> (b -> Doc) -> (CSize -> Doc -> Doc) -> ([Doc] -> Doc) -> (Doc -> Doc -> Doc) -> Map a b -> Doc Source #

ppPairlist :: (a -> Doc) -> (b -> Doc) -> (CSize -> Doc -> Doc) -> ([Doc] -> Doc) -> (Doc -> Doc -> Doc) -> [(a, b)] -> Doc Source #

addBullet :: Doc -> Doc Source #

start with a bullet, i.e. formulas

showDoc :: Pretty a => a -> ShowS Source #

showGlobalDoc :: Pretty a => GlobalAnnos -> a -> ShowS Source #

like showDoc but considers global annotations