Morphism.hs revision b72a390042c19e630cf221494b60c9df2a60d187
277c685b1429c51f92b006f38aca4b89e0f4f2fdChristian Maeder{-# OPTIONS -fallow-undecidable-instances #-}
277c685b1429c51f92b006f38aca4b89e0f4f2fdChristian Maeder{- |
277c685b1429c51f92b006f38aca4b89e0f4f2fdChristian MaederModule : $Header$
277c685b1429c51f92b006f38aca4b89e0f4f2fdChristian MaederDescription : Instance of class Logic for propositional logic
277c685b1429c51f92b006f38aca4b89e0f4f2fdChristian MaederCopyright : (c) Dominik Luecke, Uni Bremen 2007
277c685b1429c51f92b006f38aca4b89e0f4f2fdChristian MaederLicense : similar to LGPL, see HetCATS/LICENSE.txt or LIZENZ.txt
277c685b1429c51f92b006f38aca4b89e0f4f2fdChristian Maeder
8cd8515a95c02d0701aa8a52d3dba93b96b8f875Christian MaederMaintainer : luecke@tzi.de
8191ab400cc9ebb5a3f6c6f18104a208aae187e8Christian MaederStability : experimental
2a776f7803cf5250668849ab0af9d378dfefd2f3Christian MaederPortability : portable
8cd8515a95c02d0701aa8a52d3dba93b96b8f875Christian Maeder
8cd8515a95c02d0701aa8a52d3dba93b96b8f875Christian MaederDefinition of morphisms for propositional logic
2a776f7803cf5250668849ab0af9d378dfefd2f3Christian Maeder-}
8cd8515a95c02d0701aa8a52d3dba93b96b8f875Christian Maeder
8cd8515a95c02d0701aa8a52d3dba93b96b8f875Christian Maedermodule Propositional.Morphism where
8cd8515a95c02d0701aa8a52d3dba93b96b8f875Christian Maeder
dda27ed86257e0480f862b841259819f59d4724ecmaederimport qualified Common.InjMap as InjMap
dda27ed86257e0480f862b841259819f59d4724ecmaederimport qualified Common.Lib.Set as Set
dda27ed86257e0480f862b841259819f59d4724ecmaederimport Propositional.Sign as Sign
e938e50e25d4a2365fab789af709590d3d6ce89dcmaederimport Common.Id
516ca24f64f1b6e45577ee44dced94e7e358336bChristian Maeder
8191ab400cc9ebb5a3f6c6f18104a208aae187e8Christian Maedertype PropMap = InjMap.InjMap Id Id
277c685b1429c51f92b006f38aca4b89e0f4f2fdChristian Maeder
data Morphism = Morphism
{
source :: Sign
, target :: Sign
, propMap :: PropMap
} deriving (Eq, Show)
idMor :: Sign -> Morphism
idMor a = Morphism
{ source = a
, target = a
, propMap = makeIdMor $ items a
}
makeIdMor :: (Ord a) => Set.Set a -> InjMap.InjMap a a
makeIdMor a = Set.fold (\x -> InjMap.insert x x) InjMap.empty a