Sign.hs revision 6d81916b9004f8d9b6032113c5987ab07da47015
57221209d11b05aa0373cc3892d5df89ba96ebf9Christian Maeder{- |
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
98890889ffb2e8f6f722b00e265a211f13b5a861Corneliu-Claudiu Prodescu
53bd0c89aa4743dc41a6394db5a90717c1ca4517Liam O'ReillyMaintainer : kluc@informatik.uni-bremen.de
53bd0c89aa4743dc41a6394db5a90717c1ca4517Liam O'ReillyStability : experimental
53bd0c89aa4743dc41a6394db5a90717c1ca4517Liam O'ReillyPortability : portable
53bd0c89aa4743dc41a6394db5a90717c1ca4517Liam O'Reilly
53bd0c89aa4743dc41a6394db5a90717c1ca4517Liam O'ReillyDefinition of signatures for common logic
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reilly-}
53bd0c89aa4743dc41a6394db5a90717c1ca4517Liam O'Reilly
53bd0c89aa4743dc41a6394db5a90717c1ca4517Liam O'Reillymodule CommonLogic.Sign
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reilly (Sign (..) --
9aeda2b3ae8ce0b018955521e4ca835a8ba8a27bLiam O'Reilly ,pretty -- pretty printing
57221209d11b05aa0373cc3892d5df89ba96ebf9Christian Maeder ,emptySig -- empty signature
66bc8d6e69cde43f1ccbeb76104cf7b8038acd6cChristian Maeder ) where
66bc8d6e69cde43f1ccbeb76104cf7b8038acd6cChristian Maeder
e90dc723887d541f809007ae81c9bb73ced9592eChristian Maederimport qualified Data.Set as Set
d5833d2ee7bafcbf2fdd2bdfd9a728c769b100c7Christian Maederimport Common.Id
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reillyimport Common.Doc
56899f6457976a2ee20f6a23f088cb5655b15715Liam O'Reillyimport Common.DocUtils
66bc8d6e69cde43f1ccbeb76104cf7b8038acd6cChristian Maeder
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)
53bd0c89aa4743dc41a6394db5a90717c1ca4517Liam O'Reilly
648fe1220044aac847acbdfbc4155af5556063ebChristian Maederinstance Pretty Sign where
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder pretty = printSign
7830e8fa7442fb7452af7ecdba102bc297ae367eChristian Maeder
648fe1220044aac847acbdfbc4155af5556063ebChristian Maeder-- | The empty signature
d5833d2ee7bafcbf2fdd2bdfd9a728c769b100c7Christian MaederemptySig :: Sign
33bdce26495121cdbce30331ef90a1969126a840Liam O'ReillyemptySig = Sign {items = Set.empty}
c0833539c8cf577dd3f2497792fbdd818442744cChristian Maeder
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reilly-- | pretty printing for Signatures
33bdce26495121cdbce30331ef90a1969126a840Liam O'ReillyprintSign :: Sign -> Doc
7830e8fa7442fb7452af7ecdba102bc297ae367eChristian MaederprintSign s =
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reilly hsep [text "prop", sepByCommas $ map pretty $ Set.toList $ items s]
fa373bc327620e08861294716b4454be8d25669fChristian Maeder