Sentence.hs revision c71a28752b8269572ba1de2e2230bb97a4dde6ea
ca010363454de207082dfaa4b753531ce2a34551Christian Maeder{- |
e9458b1a7a19a63aa4c179f9ab20f4d50681c168Jens ElknerModule : $Header$
59a2f25e7d71b91b4eda6fa4da753473ad629619Christian MaederDescription : Sentences for Maude
49fc18b4bb1d4a8d3ec05e0cffd5f0475b289592Christian MaederCopyright : (c) Martin Kuehl, Uni Bremen 2008
98890889ffb2e8f6f722b00e265a211f13b5a861Corneliu-Claudiu ProdescuLicense : similar to LGPL, see HetCATS/LICENSE.txt or LIZENZ.txt
ca010363454de207082dfaa4b753531ce2a34551Christian Maeder
3f69b6948966979163bdfe8331c38833d5d90ecdChristian MaederMaintainer : mkhl@informatik.uni-bremen.de
ca010363454de207082dfaa4b753531ce2a34551Christian MaederStability : experimental
49fc18b4bb1d4a8d3ec05e0cffd5f0475b289592Christian MaederPortability : portable
ca010363454de207082dfaa4b753531ce2a34551Christian Maeder
79d11c2e3ad242ebb241f5d4a5e98a674c0b986fChristian MaederDefinition of sentences for Maude.
ca010363454de207082dfaa4b753531ce2a34551Christian Maeder-}
ca010363454de207082dfaa4b753531ce2a34551Christian Maeder{-
ac142c1b088711f911018d8108a64be80b2f2a58Christian Maeder Ref.
ac142c1b088711f911018d8108a64be80b2f2a58Christian Maeder
1eb10c0c30323eed3cc21082fd242cd09a612dc5Christian Maeder ...
ac142c1b088711f911018d8108a64be80b2f2a58Christian Maeder-}
ac142c1b088711f911018d8108a64be80b2f2a58Christian Maeder
ac142c1b088711f911018d8108a64be80b2f2a58Christian Maedermodule Maude.Sentence (
ac142c1b088711f911018d8108a64be80b2f2a58Christian Maeder Sentence(..),
d27877901128f04518461d25b96d2d93a13f01e4Christian Maeder) where
ac142c1b088711f911018d8108a64be80b2f2a58Christian Maeder
ca010363454de207082dfaa4b753531ce2a34551Christian Maederimport Maude.Meta
10b02b2343246df6773585636fe3ddbefa3b6a1bChristian Maeder
10b02b2343246df6773585636fe3ddbefa3b6a1bChristian Maederimport Data.Typeable (Typeable)
10b02b2343246df6773585636fe3ddbefa3b6a1bChristian Maeder
b603f34b79bc0992e5d74f484e5bdc9f9c2346c6Christian Maeder-- for ShATermConvertible
53301de22afd7190981b363b57c48df86fcb50f7Christian Maederimport Common.ATerm.Conversion (ShATermConvertible(..))
10b02b2343246df6773585636fe3ddbefa3b6a1bChristian Maeder-- for Pretty
10b02b2343246df6773585636fe3ddbefa3b6a1bChristian Maederimport Common.DocUtils (Pretty(..))
23f8d286586ff38a9e73052b2c7c04c62c5c638fChristian Maederimport qualified Common.Doc as Doc
10b02b2343246df6773585636fe3ddbefa3b6a1bChristian Maeder
10b02b2343246df6773585636fe3ddbefa3b6a1bChristian Maeder
10b02b2343246df6773585636fe3ddbefa3b6a1bChristian Maederdata Sentence = MembAx MembAx
10b02b2343246df6773585636fe3ddbefa3b6a1bChristian Maeder | Equation Equation
e68f45f355ed9d4026ee9baff5aa75aa7c911cc2Christian Maeder -- We are excluding Rules for now.
ad270004874ce1d0697fb30d7309f180553bb315Christian Maeder deriving (Show, Eq, Ord, Typeable)
fc8c6570c7b4ee13f375eb607bed2290438573bfChristian Maeder
83cc27e4ca7cf1a4bb5f4a8df17d3e6d44e6f1eaChristian Maeder-- TODO: Add real pretty-printing for Maude Sentences.
53301de22afd7190981b363b57c48df86fcb50f7Christian Maederinstance Pretty Sentence where
028f19cdb09d52bb2fd207399b6fa874540d1670Christian Maeder pretty _ = Doc.empty
53301de22afd7190981b363b57c48df86fcb50f7Christian Maeder
83cc27e4ca7cf1a4bb5f4a8df17d3e6d44e6f1eaChristian Maeder-- TODO: Replace dummy implementation for ShATermConvertible Sentence.
59a2f25e7d71b91b4eda6fa4da753473ad629619Christian Maederinstance ShATermConvertible Sentence where
59a2f25e7d71b91b4eda6fa4da753473ad629619Christian Maeder toShATermAux table _ = return (table, 0)
59a2f25e7d71b91b4eda6fa4da753473ad629619Christian Maeder fromShATermAux _ table = (table, error "Nope...")
59a2f25e7d71b91b4eda6fa4da753473ad629619Christian Maeder
fc8c6570c7b4ee13f375eb607bed2290438573bfChristian Maeder
83cc27e4ca7cf1a4bb5f4a8df17d3e6d44e6f1eaChristian Maederinstance HasSorts Sentence where
59a2f25e7d71b91b4eda6fa4da753473ad629619Christian Maeder getSorts sen = case sen of
72b9099aeec0762bae4546db3bc4b48721027bf4Christian Maeder MembAx mb -> getSorts mb
53301de22afd7190981b363b57c48df86fcb50f7Christian Maeder Equation eq -> getSorts eq
53301de22afd7190981b363b57c48df86fcb50f7Christian Maeder mapSorts mp sen = case sen of
49fc18b4bb1d4a8d3ec05e0cffd5f0475b289592Christian Maeder MembAx mb -> MembAx (mapSorts mp mb)
53301de22afd7190981b363b57c48df86fcb50f7Christian Maeder Equation eq -> Equation (mapSorts mp eq)
53301de22afd7190981b363b57c48df86fcb50f7Christian Maeder
0a39036fa485579a7b7c81cdd44a412392571927Christian Maederinstance HasOps Sentence where
da2b959c50c95309d8eb8b24174249c2847e74b5Christian Maeder getOps sen = case sen of
0a39036fa485579a7b7c81cdd44a412392571927Christian Maeder MembAx mb -> getOps mb
9c07aad044613547d61ab235665c08adcef03a1cChristian Maeder Equation eq -> getOps eq
59a2f25e7d71b91b4eda6fa4da753473ad629619Christian Maeder mapOps mp sen = case sen of
59a2f25e7d71b91b4eda6fa4da753473ad629619Christian Maeder MembAx mb -> MembAx (mapOps mp mb)
962036a37b92afb04ac0725cde9f20e599c04c5fChristian Maeder Equation eq -> Equation (mapOps mp eq)
4b8e74c68d62fc4e5a1739b11f8df09beaecbee8Christian Maeder
4b8e74c68d62fc4e5a1739b11f8df09beaecbee8Christian Maederinstance HasLabels Sentence where
4b8e74c68d62fc4e5a1739b11f8df09beaecbee8Christian Maeder getLabels sen = case sen of
4b8e74c68d62fc4e5a1739b11f8df09beaecbee8Christian Maeder MembAx mb -> getLabels mb
59a2f25e7d71b91b4eda6fa4da753473ad629619Christian Maeder Equation eq -> getLabels eq
59a2f25e7d71b91b4eda6fa4da753473ad629619Christian Maeder mapLabels mp sen = case sen of
4b8e74c68d62fc4e5a1739b11f8df09beaecbee8Christian Maeder MembAx mb -> MembAx (mapLabels mp mb)
4b8e74c68d62fc4e5a1739b11f8df09beaecbee8Christian Maeder Equation eq -> Equation (mapLabels mp eq)
4b8e74c68d62fc4e5a1739b11f8df09beaecbee8Christian Maeder