Sign.hs revision 6d81916b9004f8d9b6032113c5987ab07da47015
53bd0c89aa4743dc41a6394db5a90717c1ca4517Liam O'ReillyModule : $Header$
53bd0c89aa4743dc41a6394db5a90717c1ca4517Liam O'ReillyDescription : Signature for common logic
53bd0c89aa4743dc41a6394db5a90717c1ca4517Liam O'ReillyCopyright : (c) Karl Luc, DFKI Bremen 2010
53bd0c89aa4743dc41a6394db5a90717c1ca4517Liam O'ReillyLicense : similar to LGPL, see HetCATS/LICENSE.txt or LIZENZ.txt
53bd0c89aa4743dc41a6394db5a90717c1ca4517Liam O'ReillyMaintainer : kluc@informatik.uni-bremen.de
53bd0c89aa4743dc41a6394db5a90717c1ca4517Liam O'ReillyStability : experimental
53bd0c89aa4743dc41a6394db5a90717c1ca4517Liam O'ReillyPortability : portable
53bd0c89aa4743dc41a6394db5a90717c1ca4517Liam O'ReillyDefinition of signatures for common logic
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reilly (Sign (..) --
9aeda2b3ae8ce0b018955521e4ca835a8ba8a27bLiam O'Reilly ,pretty -- pretty printing
57221209d11b05aa0373cc3892d5df89ba96ebf9Christian Maeder ,emptySig -- empty signature
e90dc723887d541f809007ae81c9bb73ced9592eChristian Maederimport qualified Data.Set as Set
a00461fcf7432205a79a0f12dbe6c1ebc58bc000Christian Maeder-- | Datatype for propositional Signatures
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reilly-- Signatures are just sets
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reillynewtype Sign = Sign {items :: Set.Set Id} deriving (Eq, Ord, Show)
648fe1220044aac847acbdfbc4155af5556063ebChristian Maederinstance Pretty Sign where
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder pretty = printSign
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder-- | The empty signature
d5833d2ee7bafcbf2fdd2bdfd9a728c769b100c7Christian MaederemptySig :: Sign
33bdce26495121cdbce30331ef90a1969126a840Liam O'ReillyemptySig = Sign {items = Set.empty}
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reilly-- | pretty printing for Signatures
33bdce26495121cdbce30331ef90a1969126a840Liam O'ReillyprintSign :: Sign -> Doc
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reilly hsep [text "prop", sepByCommas $ map pretty $ Set.toList $ items s]