ExtSign.hs revision f9e0b18852b238ddb649d341194e05d7200d1bbe
{- |
Module : $Header$
Description : signatures with symbol sets
Copyright : (c) DFKI GmbH, Uni Bremen 2002-2007
License : similar to LGPL, see HetCATS/LICENSE.txt or LIZENZ.txt
Maintainer : Christian.Maeder@dfki.de
Stability : provisional
Portability : portable
Some functions that operate over signatures need to be extended to work over
signatures with symbol sets for every logic
-}
module Common.ExtSign where
import qualified Data.Set as Set
import Common.Doc
import Common.DocUtils
-- | signatures with symbol sets.
-- (The Ord instance is needed for the ATC generation)
data Ord symbol => ExtSign sign symbol = ExtSign
{ plainSign :: sign
, nonImportedSymbols :: (Set.Set symbol)
} deriving Show
instance (Ord symbol, Eq sign) => Eq (ExtSign sign symbol) where
ExtSign s1 _ == ExtSign s2 _ = s1 == s2
instance (Pretty sign, Ord symbol, Pretty symbol)
=> Pretty (ExtSign sign symbol) where
pretty (ExtSign s sys) =
sep [pretty s, if Set.null sys then empty else pretty sys]
mkExtSign :: Ord symbol => sign -> ExtSign sign symbol
mkExtSign s = ExtSign s Set.empty