CASLSig.hs revision dcc647f49095d0eb39e1253bb5a591b5fbc4c1fd
{- |
Module : $Header$
Description : Central datastructures for development graphs
Copyright : (c) Till Mossakowski, Uni Bremen 2002-2006
License : similar to LGPL, see HetCATS/LICENSE.txt or LIZENZ.txt
Maintainer : till@informatik.uni-bremen.de
Stability : provisional
Portability : non-portable(Logic)
Fixed CASL signature needed for translation of CommonLogic to CASL
-}
module CommonLogic.CASLSig where
import qualified CASL.Sign as CSign
import qualified Driver.AnaLib as AnaLib
import qualified Driver.Options as Options
import qualified Data.Map as Map
import qualified System.IO.Unsafe as SysUnsafe
import qualified Static.DevGraph as DevGraph
import qualified Logic.Grothendieck as Grothendieck
import qualified Common.ExtSign as ExtSign
import qualified Logic.Coerce as Coerce
import qualified CASL.Logic_CASL as CASL
baseCASLSig :: CSign.CASLSign
baseCASLSig = sig
where Just (_,lib) = SysUnsafe.unsafePerformIO $ AnaLib.anaLib Options.defaultHetcatsOpts "CommonLogic/CommonLogic.casl"
dgraph = head $ Map.elems lib
gsig = head $ Map.elems $ DevGraph.sigMap dgraph
Just esig = case gsig of
Grothendieck.G_sign lid extsign _
-> Coerce.coerceSign lid CASL.CASL "error: CommonoLogic.CASLSig" extsign
ExtSign.ExtSign sig _ = esig