Comorphisms.hs revision e9458b1a7a19a63aa4c179f9ab20f4d50681c168
55cf6e01272ec475edea32aa9b7923de2d36cb42Christian Maeder{-# LANGUAGE MultiParamTypeClasses, TypeSynonymInstances, FlexibleInstances #-}
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maeder{- |
e9458b1a7a19a63aa4c179f9ab20f4d50681c168Jens ElknerModule : ./CspCASL/Comorphisms.hs
286f4deb69d3912337bb09dd7f81284d12912ce8Christian MaederDescription : generic CspCASL instance for comorphisms
286f4deb69d3912337bb09dd7f81284d12912ce8Christian MaederCopyright : (c) Liam O'Reilly, Swansea University 2009
98890889ffb2e8f6f722b00e265a211f13b5a861Corneliu-Claudiu ProdescuLicense : GPLv2 or higher, see LICENSE.txt
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maeder
286f4deb69d3912337bb09dd7f81284d12912ce8Christian MaederMaintainer : csliam@swansea.ac.uk
286f4deb69d3912337bb09dd7f81284d12912ce8Christian MaederStability : experimental
286f4deb69d3912337bb09dd7f81284d12912ce8Christian MaederPortability : non-portable(import Logic.Logic)
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maeder
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maeder-}
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maeder
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maedermodule CspCASL.Comorphisms where
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maeder
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maederimport Logic.Logic
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maederimport Logic.Comorphism
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maeder
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maeder-- CspCASL
12b2ae689353ecbaad720a9af9f9be01c1a3fe2dChristian Maederimport CspCASL.StatAnaCSP (CspBasicSpec)
33bdce26495121cdbce30331ef90a1969126a840Liam O'Reillyimport CspCASL.Morphism
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maederimport CspCASL.Logic_CspCASL
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maederimport CspCASL.SignCSP
3b48e17c1da54ee669e70b626d9fbc32ce495b2cChristian Maederimport CspCASL.SymbItems
3b48e17c1da54ee669e70b626d9fbc32ce495b2cChristian Maederimport CspCASL.Symbol
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maeder
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maederimport qualified Data.Set as Set
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maeder
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maeder-- | The identity of the comorphism
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maederdata CspCASL2CspCASL a b = CspCASL2CspCASL a b deriving Show
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maeder
286f4deb69d3912337bb09dd7f81284d12912ce8Christian MaedercspCASLTrace :: CspCASL2CspCASL () Trace
286f4deb69d3912337bb09dd7f81284d12912ce8Christian MaedercspCASLTrace = CspCASL2CspCASL () Trace
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maeder
286f4deb69d3912337bb09dd7f81284d12912ce8Christian MaedercspCASLFailure :: CspCASL2CspCASL () Failure
286f4deb69d3912337bb09dd7f81284d12912ce8Christian MaedercspCASLFailure = CspCASL2CspCASL () Failure
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maeder
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maederinstance (Show a, Show b) => Language (CspCASL2CspCASL a b) where
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maeder language_name (CspCASL2CspCASL a b) =
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maeder language_name (GenCspCASL a)
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maeder ++ "2" ++ language_name (GenCspCASL b)
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maeder
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maederinstance (CspCASLSemantics a, CspCASLSemantics b)
3b48e17c1da54ee669e70b626d9fbc32ce495b2cChristian Maeder => Comorphism (CspCASL2CspCASL a b)
3b48e17c1da54ee669e70b626d9fbc32ce495b2cChristian Maeder (GenCspCASL a) ()
23a0d43ca980983c7d7aebaa9f03bfe120be7de8Christian Maeder CspBasicSpec CspCASLSen CspSymbItems CspSymbMapItems
3b48e17c1da54ee669e70b626d9fbc32ce495b2cChristian Maeder CspCASLSign CspCASLMorphism CspSymbol CspRawSymbol ()
3b48e17c1da54ee669e70b626d9fbc32ce495b2cChristian Maeder (GenCspCASL b) ()
23a0d43ca980983c7d7aebaa9f03bfe120be7de8Christian Maeder CspBasicSpec CspCASLSen CspSymbItems CspSymbMapItems
3b48e17c1da54ee669e70b626d9fbc32ce495b2cChristian Maeder CspCASLSign CspCASLMorphism CspSymbol CspRawSymbol () where
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maeder sourceLogic (CspCASL2CspCASL a _) = GenCspCASL a
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maeder sourceSublogic _ = ()
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maeder targetLogic (CspCASL2CspCASL _ b) = GenCspCASL b
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maeder mapSublogic _ _ = Just ()
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maeder map_theory _ = return
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maeder map_morphism _ = return
3b48e17c1da54ee669e70b626d9fbc32ce495b2cChristian Maeder map_sentence _ = const return
400321fd7a25a1c34eb95855ee86daf722734bd4Mihai Codescu map_symbol _ _ = Set.singleton
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maeder is_model_transportable _ = True
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maeder has_model_expansion _ = True
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maeder is_weakly_amalgamable _ = True
286f4deb69d3912337bb09dd7f81284d12912ce8Christian Maeder isInclusionComorphism _ = True