As.hs revision cb26aa08ea668c555cc2916d682e072c4de73d9d
f1edf379717f0ddb7607585a027cf6f03a6fce68Christian MaederModule : $Header$
f1edf379717f0ddb7607585a027cf6f03a6fce68Christian MaederDescription : abstract ADL syntax
98890889ffb2e8f6f722b00e265a211f13b5a861Corneliu-Claudiu ProdescuCopyright : (c) Stef Joosten, Christian Maeder DFKI GmbH 2010
b87efd3db0d2dc41615ea28669faf80fc1b48d56Corneliu-Claudiu ProdescuLicense : GPLv2 or higher
f1edf379717f0ddb7607585a027cf6f03a6fce68Christian MaederMaintainer : Christian.Maeder@dfki.de
f1edf379717f0ddb7607585a027cf6f03a6fce68Christian MaederStability : provisional
b87efd3db0d2dc41615ea28669faf80fc1b48d56Corneliu-Claudiu ProdescuPortability : portable
26db4a742376d513cdba128780ee8ca60eeb927eTill Mossakowski = C Token -- ^ The name of this Concept
26db4a742376d513cdba128780ee8ca60eeb927eTill Mossakowski | Anything -- ^ Really anything as introduced by I and V
26db4a742376d513cdba128780ee8ca60eeb927eTill Mossakowski deriving (Eq, Ord, Show)
26db4a742376d513cdba128780ee8ca60eeb927eTill Mossakowskiinstance GetRange Concept where
26db4a742376d513cdba128780ee8ca60eeb927eTill Mossakowski getRange c = case c of
26db4a742376d513cdba128780ee8ca60eeb927eTill Mossakowski C t -> getRange t
26db4a742376d513cdba128780ee8ca60eeb927eTill Mossakowski Anything -> nullRange
26db4a742376d513cdba128780ee8ca60eeb927eTill Mossakowski rangeSpan c = case c of
26db4a742376d513cdba128780ee8ca60eeb927eTill Mossakowski C t -> rangeSpan t
26db4a742376d513cdba128780ee8ca60eeb927eTill Mossakowski Anything -> []
26db4a742376d513cdba128780ee8ca60eeb927eTill Mossakowskidata RelType = RelType
26db4a742376d513cdba128780ee8ca60eeb927eTill Mossakowski { relSrc :: Concept -- ^ the source concept
9a80079e082fdf4fe8e19f8fc61e6cd8799b47a7Christian Maeder , relTrg :: Concept -- ^ the target concept
26db4a742376d513cdba128780ee8ca60eeb927eTill Mossakowski } deriving (Eq, Ord, Show)
9a80079e082fdf4fe8e19f8fc61e6cd8799b47a7Christian Maederinstance GetRange RelType where
26db4a742376d513cdba128780ee8ca60eeb927eTill Mossakowski getRange = getRange . relSrc
26db4a742376d513cdba128780ee8ca60eeb927eTill Mossakowski rangeSpan (RelType c1 c2) =
26db4a742376d513cdba128780ee8ca60eeb927eTill Mossakowski joinRanges [rangeSpan c1, rangeSpan c2]
26db4a742376d513cdba128780ee8ca60eeb927eTill Mossakowskidata Relation = Sgn
26db4a742376d513cdba128780ee8ca60eeb927eTill Mossakowski { decnm :: Token -- ^ the name
26db4a742376d513cdba128780ee8ca60eeb927eTill Mossakowski , relType :: RelType
9a80079e082fdf4fe8e19f8fc61e6cd8799b47a7Christian Maeder } deriving (Eq, Ord, Show)
26db4a742376d513cdba128780ee8ca60eeb927eTill Mossakowskiinstance GetRange Relation where
26db4a742376d513cdba128780ee8ca60eeb927eTill Mossakowski getRange = getRange . decnm
26db4a742376d513cdba128780ee8ca60eeb927eTill Mossakowski rangeSpan (Sgn n t) =
26db4a742376d513cdba128780ee8ca60eeb927eTill Mossakowski joinRanges [rangeSpan n, rangeSpan t]
26db4a742376d513cdba128780ee8ca60eeb927eTill Mossakowski-- | builtin relation over Anything
26db4a742376d513cdba128780ee8ca60eeb927eTill MossakowskibRels :: [String]