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-Inferred

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

Minimal complete definition

pretty

Methods

pretty :: a -> Doc

pretties :: [a] -> Doc

Instances

Pretty Char 
Pretty Double

Pretty printing Double

Pretty Int 
Pretty Integer 
Pretty Ordering 
Pretty () 
Pretty InfInt 
Pretty Sign 
Pretty NamedObject 
Pretty PlacedObject 
Pretty ExtendedObject 
Pretty Object 
Pretty BaseObject 
Pretty Placement 
Pretty Vector4 
Pretty Matrix33 
Pretty Vector3 
Pretty DatatypeFacet 
Pretty ProofMethod 
Pretty Modifier 
Pretty ProofEnd 
Pretty ProofCommand 
Pretty IsaProof 
Pretty Sign 
Pretty Sentence 
Pretty Id 
Pretty Token 
Pretty Range 
Pretty IRI 
Pretty Annotation 
Pretty GlobalAnnos 
Pretty Diagnosis 
Pretty Conservativity 
Pretty Sign 
Pretty Sentence 
Pretty OMName 
Pretty AnnotationValue

annotations printing

Pretty Annotation 
Pretty ClassExpression

Printing the ClassExpression

Pretty DataRange

Printing the DataRange

Pretty ObjectPropertyExpression 
Pretty Literal 
Pretty Entity 
Pretty Character 
Pretty QName 
Pretty RDFEntity 
Pretty RDFEntityType

Symbols printing

Pretty Axiom 
Pretty Term 
Pretty RDFLiteral 
Pretty PredicateObjectList 
Pretty Object 
Pretty Predicate 
Pretty Subject 
Pretty Triples 
Pretty Statement 
Pretty TurtleDocument 
Pretty Sign 
Pretty RawSymb 
Pretty SymbMapItems 
Pretty SymbItems 
Pretty RawSymb 
Pretty SymbMapItems 
Pretty SymbItems 
Pretty ExtEntityType

Symbols printing

Pretty Sign 
Pretty OntologyDocument 
Pretty Ontology

Printing the ontology

Pretty Axiom 
Pretty Frame 
Pretty FrameBit 
Pretty Fact 
Pretty ListFrameBit 
Pretty RDFMorphism 
Pretty OWLMorphism 
Pretty Sign 
Pretty SYMB_ITEMS 
Pretty SYMB_OR_MAP 
Pretty SYMB_MAP_ITEMS 
Pretty NAME_OR_SEQMARK 
Pretty TERM_SEQ 
Pretty TERM 
Pretty ATOM 
Pretty ImplEq 
Pretty AndOr 
Pretty BOOL_SENT 
Pretty QUANT 
Pretty SENTENCE 
Pretty IMPORTATION 
Pretty MODULE 
Pretty COMMENT 
Pretty PHRASE 
Pretty TEXT 
Pretty TEXT_META 
Pretty BASIC_ITEMS 
Pretty BASIC_SPEC 
Pretty Morphism 
Pretty Symbol 
Pretty OpId 
Pretty LabelId 
Pretty ModId 
Pretty ViewId 
Pretty ParamId 
Pretty Kind 
Pretty Sort 
Pretty Type 
Pretty Term 
Pretty Hook 
Pretty StmntAttr 
Pretty Attr 
Pretty Condition 
Pretty Rule 
Pretty Equation 
Pretty Membership 
Pretty MaudeText 
Pretty Symbol 
Pretty Sentence 
Pretty Sign 
Pretty Morphism 
Pretty ComorphismDef 
Pretty LogicDef 
Pretty FRAM 
Pretty SYMB_OR_MAP 
Pretty SYMB_MAP_ITEMS 
Pretty SYMB_ITEMS 
Pretty BASIC_ITEM 
Pretty BASIC_SPEC 
Pretty Sign 
Pretty DEF 
Pretty EXP 
Pretty Symbol 
Pretty Morphism 
Pretty SYMB_OR_MAP 
Pretty SYMB_MAP_ITEMS 
Pretty SYMB_ITEMS 
Pretty FORMULA 
Pretty TERM 
Pretty TYPE 
Pretty BASIC_ITEM 
Pretty BASIC_SPEC 
Pretty Sign 
Pretty CONTEXT 
Pretty KIND 
Pretty Symbol 
Pretty Morphism 
Pretty Sign 
Pretty FORMULA 
Pretty BASIC_SPEC 
Pretty Morphism 
Pretty Symbol 
Pretty SYMB_OR_MAP 
Pretty TYPE 
Pretty SYMB 
Pretty SYMB_KIND 
Pretty SYMB_MAP_ITEMS 
Pretty SYMB_ITEMS 
Pretty OP_SYMB 
Pretty PRED_SYMB 
Pretty VAR_DECL 
Pretty COMPONENTS 
Pretty ALTERNATIVE 
Pretty DATATYPE_DECL 
Pretty PRED_TYPE 
Pretty OP_HEAD 
Pretty OP_TYPE 
Pretty Symbol 
Pretty PredType 
Pretty OpType 
Pretty RawSymbol 
Pretty CoCASLSign 
Pretty RSMorphism 
Pretty RSTMap 
Pretty RSTables 
Pretty RSTable 
Pretty RSColumn 
Pretty RSSymbol 
Pretty RSDatatype 
Pretty RSScheme 
Pretty RSRelationships 
Pretty RSRel 
Pretty RSQualId 
Pretty Morphism 
Pretty Inclusion 
Pretty Symbol 
Pretty Theory 
Pretty Component 
Pretty ConstraintFORMULA 
Pretty DL_FORMULA 
Pretty AnnoLiteral 
Pretty AnnoAppl 
Pretty CASL_DLSign 
Pretty COL_SIG_ITEM 
Pretty COLSign 
Pretty PROCESS 
Pretty CommType 
Pretty FQ_PROCESS_NAME 
Pretty ProcProfile

Pretty printing for process profiles

Pretty RENAMING 
Pretty Rename 
Pretty EVENT_SET 
Pretty EVENT 
Pretty PARM_PROCNAME 
Pretty PROC_ITEM 
Pretty CHANNEL_DECL 
Pretty CspBasicExt 
Pretty CspSen 
Pretty CspSign

Pretty printing for CspCASL signatures

Pretty CspSymbMap 
Pretty CspType 
Pretty CspSymb 
Pretty CspSymbKind 
Pretty CspSymbMapItems 
Pretty CspSymbItems 
Pretty CspRawSymbol 
Pretty CspSymbol 
Pretty CspAddMorphism

a dummy instances used for the default definition

Pretty C_FORMULA 
Pretty MODALITY 
Pretty COCOMPONENTS 
Pretty COALTERNATIVE 
Pretty CODATATYPE_DECL 
Pretty C_SIG_ITEM 
Pretty C_BASIC_ITEM 
Pretty EM_FORMULA 
Pretty FormPrefix 
Pretty EM_SIG_ITEM 
Pretty MODALITY 
Pretty EM_BASIC_ITEM 
Pretty ModDefn 
Pretty FrameForm 
Pretty EModalSign 
Pretty MorphExtension 
Pretty Sign 
Pretty SYMB_OR_MAP 
Pretty SYMB_MAP_ITEMS 
Pretty SYMB 
Pretty SYMB_ITEMS 
Pretty FORMULA 
Pretty BASIC_ITEMS 
Pretty BASIC_SPEC 
Pretty PRED_ITEM 
Pretty Morphism 
Pretty Symbol 
Pretty H_FORMULA 
Pretty NOMINAL 
Pretty MODALITY 
Pretty H_SIG_ITEM 
Pretty RIGOR 
Pretty H_BASIC_ITEM 
Pretty HybridSign 
Pretty M_FORMULA 
Pretty MODALITY 
Pretty M_SIG_ITEM 
Pretty RIGOR 
Pretty M_BASIC_ITEM 
Pretty ModalSign 
Pretty Context 
Pretty PatElem 
Pretty Pair 
Pretty RuleHeader 
Pretty RuleKind 
Pretty KeyDef 
Pretty KeyAtt 
Pretty Object 
Pretty RangedProp 
Pretty Prop 
Pretty Rule 
Pretty MulOp 
Pretty UnOp 
Pretty Relation 
Pretty RelType 
Pretty Concept 
Pretty Sen 
Pretty RawSymbol 
Pretty Symbol 
Pretty Sign 
Pretty TypedRule 
Pretty TermExt 
Pretty FunDef 
Pretty FplOpItem 
Pretty FplSortItem 
Pretty FplExt 
Pretty SignExt 
Pretty Number 
Pretty AtomicWord 
Pretty Name 
Pretty FormulaData 
Pretty GeneralFunction 
Pretty GeneralData 
Pretty GeneralTerm 
Pretty StatusValue 
Pretty InferenceStatus 
Pretty InferenceItem 
Pretty FormulaItem 
Pretty InfoItem 
Pretty TheoryName 
Pretty FileSource 
Pretty ExternalSource 
Pretty IntroType 
Pretty ParentInfo 
Pretty DagSource 
Pretty Source 
Pretty PrincipalSymbol 
Pretty SystemTerm 
Pretty DefinedFunctor 
Pretty DefinedPlainTerm 
Pretty DefinedAtom 
Pretty DefinedTerm 
Pretty PlainTerm 
Pretty FunctionTerm 
Pretty Term 
Pretty DefinedPred 
Pretty DefinedProp 
Pretty DefinedPlainFormula 
Pretty DefinedType 
Pretty AssocConnective 
Pretty THFUnaryConnective 
Pretty THFPairConnective 
Pretty Quantifier 
Pretty THFQuantifier 
Pretty THFConnTerm 
Pretty THFSequent 
Pretty THFAtom 
Pretty THFBinaryType 
Pretty THFUnitaryType 
Pretty THFTopLevelType 
Pretty THFSubType 
Pretty THFTypeableFormula 
Pretty THFTypeFormula 
Pretty THFTypedConst 
Pretty THFVariable 
Pretty THFQuantifiedFormula 
Pretty THFUnitaryFormula 
Pretty THFBinaryTuple 
Pretty THFBinaryFormula 
Pretty THFLogicFormula 
Pretty THFFormula 
Pretty FormulaRole 
Pretty Annotations 
Pretty Include 
Pretty SystemComment 
Pretty DefinedComment 
Pretty Comment 
Pretty TPTP_THF 
Pretty Kind 
Pretty Type 
Pretty SymbolTHF 
Pretty BasicSpecTHF 
Pretty ConstInfo 
Pretty TypeInfo 
Pretty SignTHF 
Pretty Link 
Pretty Object 
Pretty Model 
Pretty MultiplicityElement 
Pretty Property 
Pretty TypedElement 
Pretty Class 
Pretty Datatype 
Pretty DataTypeOrClass 
Pretty Type 
Pretty TypeOrTypedElement 
Pretty NamedElement 
Pretty Metamodel 
Pretty STRING 
Pretty OCL 
Pretty RelInvok 
Pretty WhenWhere 
Pretty PropertyTemplate 
Pretty ObjectTemplate 
Pretty Domain 
Pretty PrimitiveDomain 
Pretty RelVar 
Pretty Relation 
Pretty PropKey 
Pretty Key 
Pretty Transformation 
Pretty Sen 
Pretty ConstraintType 
Pretty MultConstr 
Pretty Sign 
Pretty LinkT 
Pretty PropertyT 
Pretty TypeClass 
Pretty TypeKind 
Pretty Pattern 
Pretty RelationSen 
Pretty Sen 
Pretty Sign 
Pretty RuleDef 
Pretty SPCRBIND 
Pretty SPSettingLabel 
Pretty SPHypothesis 
Pretty SPSettingBody 
Pretty SPSetting 
Pretty SPLogState

Creates a Doc from an SPLogState.

Pretty SPDescription

Creates a Doc from a SPASS description.

Pretty SPValue 
Pretty SPKey 
Pretty SPParent 
Pretty SPUserRuleAppl 
Pretty SPRuleAppl 
Pretty SPResult 
Pretty SPReference 
Pretty SPProofList 
Pretty SPSymbol

Creates a Doc from a SPASS Symbol. printSymbol :: SPSymbol-> Doc

Pretty SPQuantSym

Creates a Doc from a SPASS Quantifier Symbol.

Pretty TPTP 
Pretty SPTerm

Creates a Doc from a SPASS Term.

Pretty TermWsList 
Pretty NSPClause 
Pretty SPClauseType 
Pretty SPOriginType

Creates a Doc from a SPASS Origin Type

Pretty SPClauseList 
Pretty SPFormulaList

Creates a Doc from a SPASS Formula List

Pretty SPDeclaration

Creates a Doc from a SPASS Declaration

Pretty SPSignSym

Helper function. Creates a Doc from a Signature Symbol.

Pretty SPSymbolList

Creates a Doc from a SPASS Symbol List.

Pretty SPLogicalPart

Creates a Doc from a SPASS Logical Part.

Pretty SPProblem

Creates a Doc from a SPASS Problem.

Pretty SFSymbType 
Pretty SFSymbol 
Pretty Sign 
Pretty HsDecls 
Pretty Sign 
Pretty SYMB_OR_MAP 
Pretty SYMB_MAP_ITEMS 
Pretty SYMB 
Pretty SYMB_ITEMS 
Pretty CMD 
Pretty OpDecl 
Pretty VarDecl 
Pretty EXPRESSION 
Pretty ConstantName 
Pretty OPID 
Pretty EPVal 
Pretty EPDecl 
Pretty EXTPARAM 
Pretty BASIC_ITEM 
Pretty InstantiatedConstant 
Pretty AssDefinition 
Pretty GroundConstant 
Pretty BASIC_SPEC 
Pretty VAR_ITEM 
Pretty OP_ITEM 
Pretty Sign 
Pretty Morphism 
Pretty Symbol 
Pretty SYMBORMAP 
Pretty SYMBMAPITEMS 
Pretty SYMB 
Pretty SYMBITEMS 
Pretty FORMULA 
Pretty BASICITEMS 
Pretty BASICSPEC 
Pretty PREDITEM 
Pretty Morphism 
Pretty Symbol 
Pretty SymbOrMap 
Pretty Symb 
Pretty SymbMapItems 
Pretty SymbItems 
Pretty GenVarDecl 
Pretty TypeArg 
Pretty VarDecl 
Pretty PolyId 
Pretty ProgEq 
Pretty Term 
Pretty TypeQual 
Pretty Quantifier 
Pretty Component 
Pretty Alternative 
Pretty DatatypeDecl 
Pretty OpAttr 
Pretty BinOpAttr 
Pretty Partiality 
Pretty TypeScheme 
Pretty Type 
Pretty TypePattern 
Pretty Vars 
Pretty TypeItem 
Pretty Variance 
Pretty ClassDecl 
Pretty ClassItem 
Pretty OpBrand 
Pretty SigItems 
Pretty BasicItem 
Pretty BasicSpec 
Pretty RawSymbol 
Pretty Symbol 
Pretty Morphism 
Pretty Constrain 
Pretty Env 
Pretty OpInfo 
Pretty OpDefn 
Pretty ConstrInfo 
Pretty VarDefn 
Pretty TypeVarDefn 
Pretty Sentence 
Pretty TypeInfo 
Pretty TypeDefn 
Pretty DataEntry 
Pretty Selector 
Pretty ClassInfo 
Pretty LibName 
Pretty ConsStatus 
Pretty ThmLinkStatus 
Pretty DGRule 
Pretty EdgeId 
Pretty NodeName 
Pretty Text 
Pretty Mor 
Pretty Spc_Wrap 
Pretty Frm_Wrap 
Pretty TH_BASIC_ITEM 
Pretty Sgn_Wrap 
Pretty AnyComorphism 
Pretty GMorphism 
Pretty LogicGraph 
Pretty G_morphism 
Pretty G_symb_map_items_list 
Pretty G_symb_items_list 
Pretty G_symbol 
Pretty G_sign 
Pretty G_basic_spec 
Pretty G_theory 
Pretty CORRESPONDENCE 
Pretty LABELED_ONTO_OR_INTPR_REF 
Pretty Logic_name 
Pretty Logic_code 
Pretty LogicDescr 
Pretty G_hiding 
Pretty G_mapping 
Pretty RESTRICTION 
Pretty RENAMING 
Pretty Procs 
Pretty Defproc 
Pretty VSEforms 
Pretty VarDecl 
Pretty PlainProgram 
Pretty Procdecls 
Pretty Sigentry 
Pretty Profile 
Pretty Procparam 
Pretty ItemNameMap 
Pretty ALIGN_ARITIES 
Pretty Text 
Pretty DGraph 
Pretty Diag 
Pretty RTNodeLab 
Pretty RTNodeType 
Pretty DGChange 
Pretty AlignSig 
Pretty GlobalEntry 
Pretty RefSig 
Pretty ImpUnitSigOrSig 
Pretty UnitSig 
Pretty ExtViewSig 
Pretty ExtGenSig 
Pretty DGLinkLab 
Pretty DGLinkType 
Pretty DGLinkOrigin 
Pretty DGNodeLab 
Pretty DGNodeInfo 
Pretty DGOrigin 
Pretty NodeSig 
Pretty a => Pretty [a] 
Pretty a => Pretty (Maybe a) 
Pretty a => Pretty (Set a) 
Pretty a => Pretty (ClosedInterval a) 
(Ord a, Pretty a) => Pretty (SetOrInterval a) 
Pretty a => Pretty (ElemWOrd a) 
Pretty a => Pretty (Annoted a) 
Pretty a => Pretty (Result a) 
Pretty a => Pretty (DefaultMorphism a) 
Pretty a => Pretty (SimpValue a) 
Pretty (TiDecl PNT) 
FormExtension f => Pretty (TERM f) 
FormExtension f => Pretty (FORMULA f) 
FormExtension f => Pretty (PRED_ITEM f) 
FormExtension f => Pretty (OP_ATTR f) 
FormExtension f => Pretty (OP_ITEM f) 
FormExtension f => Pretty (SORT_ITEM f) 
Pretty (DefMorExt e) 
Pretty a => Pretty (AnyKind a) 
Pretty f => Pretty (TH_FORMULA f) 
Pretty b => Pretty (TH_BSPEC b) 
Pretty s => Pretty (THybridSign s) 
Pretty s => Pretty (S2 s) 
Pretty a => Pretty (Ranged a) 
(Pretty a, Pretty b) => Pretty (Either a b) 
(Pretty a, Pretty b) => Pretty (a, b) 
(Pretty a, Pretty b) => Pretty (Map a b) 
(Pretty a, Pretty b) => Pretty (Gr a (Int, b)) 
(Pretty sign, Pretty symbol) => Pretty (ExtSign sign symbol) 
(Pretty s, FormExtension f) => Pretty (SIG_ITEMS s f) 
(Show f, Pretty e) => Pretty (Sign f e) 
(Pretty a, Pretty b, Pretty c) => Pretty (a, b, c) 
(Pretty b, Pretty s, FormExtension f) => Pretty (BASIC_ITEMS b s f) 
(Pretty b, Pretty s, FormExtension f) => Pretty (BASIC_SPEC b s f) 
(SignExtension e, Pretty e, Show f, MorphismExtension e m) => Pretty (Morphism f e m) 
(Pretty a, Pretty b, Pretty c, Pretty d) => Pretty (a, b, c, d) 

sidDoc :: Token -> Doc

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

printAnnotationList :: [Annotation] -> Doc

print several annotations vertically (each in a new line)

printTrailer :: [Annotation] -> Doc

print annotations flush right

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

add trailing annotation to a document

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

conditionally add a semi after the doc but before trailing annotations

startsWithSemanticAnno :: [Annotation] -> Bool

test for semantic annos before structured specs

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

print annoted items with trailing semicolons except for the last item

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

print sentence with label and non-axioms with implied annotation

fromLabelledSen :: Named s -> Annoted s

convert a named sentence into an annoted one

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

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

add global annotations for proper mixfix printing

prepPunctuate :: Doc -> [Doc] -> [Doc]

like punctuate but prepends the symbol to all tail elements

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

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

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

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

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

data CSize

container size

Constructors

CEmpty 
CSingle 
CMult 

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

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

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

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

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

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

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

pairElems :: Doc -> Doc -> Doc

addBullet :: Doc -> Doc

start with a bullet, i.e. formulas

showDoc :: Pretty a => a -> ShowS

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

like showDoc but considers global annotations