Morphism.hs revision 012594883d722e5482460b32c0442d9a0b085d05
9e0f7989de8517928b2eda024f168d1aceedcb05Christian MaederModule : $Header$
9e0f7989de8517928b2eda024f168d1aceedcb05Christian MaederDescription : Morphisms for Maude
9e0f7989de8517928b2eda024f168d1aceedcb05Christian MaederCopyright : (c) Martin Kuehl, Uni Bremen 2008
9e0f7989de8517928b2eda024f168d1aceedcb05Christian MaederLicense : similar to LGPL, see HetCATS/LICENSE.txt or LIZENZ.txt
9e0f7989de8517928b2eda024f168d1aceedcb05Christian MaederMaintainer : mkhl@informatik.uni-bremen.de
9e0f7989de8517928b2eda024f168d1aceedcb05Christian MaederStability : experimental
9e0f7989de8517928b2eda024f168d1aceedcb05Christian MaederPortability : portable
9e0f7989de8517928b2eda024f168d1aceedcb05Christian MaederDefinition of morphisms for Maude.
module Maude.Morphism (
import Maude.AS_Maude
import Maude.Symbol
import Maude.Sign (Sign)
import qualified Maude.Sign as Sign
import qualified Data.Map as Map
import Common.Result (Result)
import qualified Common.Result as Result
symbolMap mor = Map.unions [(sortMap mor), (opMap mor), (labelMap mor)]
source = Sign.insertSort from src,
target = Sign.insertSort to tgt,
sortMap = Map.insert a b smap
labelMap = Map.insert a b lmap
source = Sign.insertOpName from src,
target = Sign.insertOpName to tgt,
opMap = Map.insert a b omap
source = Sign.insertOpName from src,
target = Sign.insertOpName to tgt,
opMap = Map.insert a b omap
empty = identity Sign.empty
sortMap = Map.empty,
opMap = Map.empty,
labelMap = Map.empty
-- | target f /= source g = fail "target of the first and source of the second morphism are different"
-- apply mp nam = Map.findWithDefault nam nam mp
-- in if x == y then id else Map.insert x y
-- compose'map mp items = if Map.null (mp g)
-- apply mp nam = Map.findWithDefault nam nam mp
-- legal'source = Sign.isLegal src
-- legal'target = Sign.isLegal tgt