PredefinedSign.inline.hs.in revision 7fd4c34af8415eb699517b1b238a24c02a9a2e9b
{- |
Module : $Header$
Copyright : (c) Klaus Luettich, Uni Bremen 2004
License : similar to LGPL, see HetCATS/LICENSE.txt or LIZENZ.txt
Maintainer : luecke@informatik.uni-bremen.de
Stability : provisional
Portability : portable
Predefined signature part of CASL_DL.
This module is always compiled via C-code, because otherwise the
object file cannot be generated. It yields this error:
@/tmp/ghc1072.s:31400:Fixup of 39588 too large for field width of 16 bits@
@/tmp/ghc1072.s:31397:Fixup of 39600 too large for field width of 16 bits@
-}
module CASL_DL.PredefinedSign(predefinedSign,topSort,topSortD,dataSig_CASL) where
import CASL_DL.AS_CASL_DL
import CASL_DL.Sign
import Common.Id
import qualified Common.Lib.Rel as Rel
import qualified Data.Map as Map
import qualified Data.Set as Set
import CASL.AS_Basic_CASL
import CASL.Sign
import Control.Exception
predefinedSign :: Sign DL_FORMULA CASL_DLSign
predefinedSign = toCASL_DL_Sign $
assert (Set.member topSortD $ sortSet dataSig_CASL) $
foldl (addSig (\ _ _ -> ())) (emptySign ())
[dataSig_CASL,predefined_symbols]
toCASL_DL_Sign :: Sign (FORMULA ()) ()
-> Sign DL_FORMULA CASL_DLSign
toCASL_DL_Sign sig =
(emptySign emptyCASL_DLSign)
{ sortSet = sortSet sig
, sortRel = sortRel sig
, opMap = opMap sig
, assocOps = assocOps sig
, predMap = predMap sig
}
topSort :: SORT
topSort = Id [Token "Thing" nullRange] [] nullRange
topSortD :: SORT
topSortD = Id [Token "DATA" nullRange] [] nullRange
predefined_symbols :: Sign (FORMULA ()) ()
predefined_symbols =
((emptySign ()){ sortSet = Set.singleton topSort
, predMap =
Map.singleton (Id [Token "Nothing" nullRange] []
nullRange)
(Set.singleton (PredType [topSort]))
})
dataSig_CASL :: Sign (FORMULA ()) ()
dataSig_CASL =
(inlineSign CASL