Comorphisms.hs revision 286f4deb69d3912337bb09dd7f81284d12912ce8
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett{- |
8267b99c0d7a187abe6f87ad50530dc08f5d1cdcAndy GimblettModule : $Header$
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy GimblettDescription : generic CspCASL instance for comorphisms
98890889ffb2e8f6f722b00e265a211f13b5a861Corneliu-Claudiu ProdescuCopyright : (c) Liam O'Reilly, Swansea University 2009
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy GimblettLicense : similar to LGPL, see HetCATS/LICENSE.txt or LIZENZ.txt
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy GimblettMaintainer : csliam@swansea.ac.uk
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy GimblettStability : experimental
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy GimblettPortability : non-portable(import Logic.Logic)
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett-}
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblettmodule CspCASL.Comorphisms where
9ebbce450fb242e1a346f9f89367d8c46fcb2ec8Andy Gimblett
2cf5a456da8bb3a2bbb695414d8304426e3bd277Andy Gimblettimport Logic.Logic
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblettimport Logic.Comorphism
2cf5a456da8bb3a2bbb695414d8304426e3bd277Andy Gimblett
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett-- CASL
2cf5a456da8bb3a2bbb695414d8304426e3bd277Andy Gimblettimport CASL.Sign
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettimport CASL.AS_Basic_CASL
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettimport CASL.Morphism
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett-- CspCASL
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettimport CspCASL.Logic_CspCASL
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettimport CspCASL.SignCSP
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettimport CspCASL.AS_CspCASL (CspBasicSpec (..))
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettimport qualified Data.Set as Set
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett-- | The identity of the comorphism
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblettdata CspCASL2CspCASL a b = CspCASL2CspCASL a b deriving Show
2cf5a456da8bb3a2bbb695414d8304426e3bd277Andy Gimblett
34a4c8c6f861104cdc198282f30fae36cf3858adAndy GimblettcspCASLTrace :: CspCASL2CspCASL () Trace
34a4c8c6f861104cdc198282f30fae36cf3858adAndy GimblettcspCASLTrace = CspCASL2CspCASL () Trace
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett
2cf5a456da8bb3a2bbb695414d8304426e3bd277Andy GimblettcspCASLFailure :: CspCASL2CspCASL () Failure
34a4c8c6f861104cdc198282f30fae36cf3858adAndy GimblettcspCASLFailure = CspCASL2CspCASL () Failure
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblettinstance (Show a, Show b) => Language (CspCASL2CspCASL a b) where
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett language_name (CspCASL2CspCASL a b) =
2cf5a456da8bb3a2bbb695414d8304426e3bd277Andy Gimblett language_name (GenCspCASL a)
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett ++ "2" ++ language_name (GenCspCASL b)
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblettinstance (CspCASLSemantics a, CspCASLSemantics b)
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett => Comorphism (CspCASL2CspCASL a b)
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett (GenCspCASL a) ()
fe9b4842ac7b63bc2a5042ae829759e2874acd05Andy Gimblett CspBasicSpec CspCASLSen SYMB_ITEMS SYMB_MAP_ITEMS
fe9b4842ac7b63bc2a5042ae829759e2874acd05Andy Gimblett CspCASLSign
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett CspMorphism
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett Symbol RawSymbol ()
8e97dcf353ac3afc326ecfd167abd47897215436Andy Gimblett (GenCspCASL b) ()
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett CspBasicSpec CspCASLSen SYMB_ITEMS SYMB_MAP_ITEMS
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett CspCASLSign
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett CspMorphism
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett Symbol RawSymbol () where
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett sourceLogic (CspCASL2CspCASL a _) = GenCspCASL a
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett sourceSublogic _ = ()
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett targetLogic (CspCASL2CspCASL _ b) = GenCspCASL b
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett mapSublogic _ _ = Just ()
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett map_theory _ = return
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett map_morphism _ = return
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett map_sentence _ = \_ -> return
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett map_symbol _ = Set.singleton
34a4c8c6f861104cdc198282f30fae36cf3858adAndy Gimblett is_model_transportable _ = True
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett has_model_expansion _ = True
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett is_weakly_amalgamable _ = True
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett isInclusionComorphism _ = True
b6499fa6826cfdc288dc841be705aab6e4cc6c95Andy Gimblett