Hets - the Heterogeneous Tool Set

Copyright(c) Klaus Luettich, Christian Maeder, and Uni Bremen 2002-2006
LicenseGPLv2 or higher, see LICENSE.txt
Safe HaskellSafe-Inferred



Datastructures for annotations of (Het)CASL. There is also a paramterized data type for an Annoted item. See also chapter II.5 of the CASL Reference Manual.



data Display_format

formats to be displayed (may be extended in the future). Drop 3 from the show result to get the string for parsing and printing



swapTable :: [(a, b)] -> [(b, a)]

swap the entries of a lookup table

toTable :: Show a => [a] -> [(a, String)]

drop the first 3 characters from the show result

display_format_table :: [(Display_format, String)]

a lookup table for the textual representation of display formats

lookupDisplayFormat :: Display_format -> String

lookup the textual representation of a display format in display_format_table

data PrecRel

precedence Lower means less and BothDirections means less and greater. Higher means greater but this is syntactically not allowed in Prec_anno. NoDirection can also not be specified explicitly, but covers those ids that are not mentionend in precedences.

data Semantic_anno

semantic (line) annotations without further information. Use the same drop-3-trick as for the Display_format.

semantic_anno_table :: [(Semantic_anno, String)]

a lookup table for the textual representation of semantic annos

lookupSemanticAnno :: Semantic_anno -> String

lookup the textual representation of a semantic anno in semantic_anno_table

isLabel :: Annotation -> Bool

isLabel tests if the given Annotation is a label (a Label typically follows a formula)

isSemanticAnno :: Annotation -> Bool

isSemanticAnno tests if the given Annotation is a semantic one

isComment :: Annotation -> Bool

isComment tests if the given Annotation is a comment line or a comment group

isAnnote :: Annotation -> Bool

isAnnote is the negation of isComment

partPrefixes :: [Annotation] -> (Map String IRI, [Annotation])

separate prefix annotations and put them into a map

data Annoted a

an item wrapped in preceding (left l_annos) and following (right r_annos) annotations. opt_pos should carry the position of an optional semicolon following a formula (but is currently unused).




item :: a
opt_pos :: Range
l_annos :: [Annotation]
r_annos :: [Annotation]


Functor Annoted 
Eq a => Eq (Annoted a) 
Data a => Data (Annoted a) 
Ord a => Ord (Annoted a) 
Show a => Show (Annoted a) 
ShATermConvertible a => ShATermConvertible (Annoted a) 
GetRange a => GetRange (Annoted a) 
Pretty a => Pretty (Annoted a) 
ListCheck a => ListCheck (Annoted a)

an instance of ListCheck for Annoted stuff

PrettyLG a => PrettyLG (Annoted a) 
ShATermLG a => ShATermLG (Annoted a) 
ATermConvertibleSML a => ATermConvertibleSML (Annoted a) 
Typeable (* -> *) Annoted 

annoRange :: (a -> [Pos]) -> Annoted a -> [Pos]

data SenAttr s a

naming or labelling sentences




(Eq s, Eq a) => Eq (SenAttr s a) 
(Data s, Data a) => Data (SenAttr s a) 
(Ord s, Ord a) => Ord (SenAttr s a) 
(Show s, Show a) => Show (SenAttr s a) 
(ShATermConvertible s, ShATermConvertible a) => ShATermConvertible (SenAttr s a) 
(GetRange s, GetRange a) => GetRange (SenAttr s a) 
(ShATermLG s, ShATermLG a) => ShATermLG (SenAttr s a) 
Typeable (* -> * -> *) SenAttr 

makeNamed :: a -> s -> SenAttr s a

equip a sentence with a name

type Named s = SenAttr s String

markSen :: String -> Named s -> Named s

unmark :: Named s -> Named s

reName :: (a -> b) -> SenAttr s a -> SenAttr s b

mapNamed :: (s -> t) -> SenAttr s a -> SenAttr t a

extending sentence maps to maps on labelled sentences

mapNamedM :: Monad m => (s -> m t) -> Named s -> m (Named t)

extending sentence maybe-maps to maps on labelled sentences

mapAnM :: Monad m => (a -> m b) -> [Annoted a] -> m [Annoted b]

process all items and wrap matching annotations around the results

replaceAnnoted :: b -> Annoted a -> Annoted b

replace the item

appendAnno :: Annoted a -> [Annotation] -> Annoted a

add further following annotations

addLeftAnno :: [Annotation] -> a -> Annoted a

put together preceding annotations and an item

emptyAnno :: a -> Annoted a

decorate with no annotations

getRLabel :: Annoted a -> String

get the label following (or to the right of) an item

identAnno :: String -> Annotation -> Bool

check for an annotation starting with % and the input str (does not work for known annotation words)

hasIdentAnno :: String -> Annoted a -> Bool

test all anntotions for an item

newtype Name


Name String