PredefinedSign.inline.hs.in revision 34bff097c14521b5e57ce37279a34256e1f78aa5
{-# OPTIONS -fvia-C #-}
{- |
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:
@Compiling CASL_DL.PredefinedSign ( ./CASL_DL/PredefinedSign.hs, ./CASL_DL/PredefinedSign.o )@
@/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) 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