Le.hs revision f454c20b6c126bea7d31d400cc8824b9ee8cc6ea
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian MaederModule : $Header$
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian MaederDescription : the abstract syntax for analysis and final signature instance
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian MaederCopyright : (c) Christian Maeder and Uni Bremen 2003-2005
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian MaederLicense : similar to LGPL, see HetCATS/LICENSE.txt or LIZENZ.txt
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian MaederMaintainer : Christian.Maeder@dfki.de
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian MaederStability : experimental
e973af819c2fb17f426944c8c4cfa00de5cd81a1Christian MaederPortability : portable
4654dbb45f8a4aea7aa5fed6be22c9efff19bfcaChristian Maederabstract syntax during static analysis
module HasCASL.Le where
import HasCASL.As
import HasCASL.AsUtils
import qualified Data.Map as Map
import qualified Data.Set as Set
import qualified Common.Lib.State as State
import Common.Result
import Common.Id
import Common.AS_Annotation (Named)
import Common.GlobalAnnotations
import Common.Prec
, classKinds :: Set.Set Kind
type ClassMap = Map.Map Id ClassInfo
type IdMap = Map.Map Id Id
DataEntry IdMap Id GenKind [TypeArg] RawKind (Set.Set AltDefn)
, otherTypeKinds :: Set.Set Kind
, superTypes :: Set.Set Id -- only declared or direct supertypes?
type TypeMap = Map.Map Id TypeInfo
mapType m ty = if Map.null m then ty else
case Map.lookup i m of
type LocalTypeVars = Map.Map Id TypeVarDefn
| SelectData (Set.Set ConstrInfo) Id -- ^ constructors of source type
, opAttrs :: Set.Set OpAttr
, localVars :: Map.Map Id VarDefn
, preIds :: (PrecMap, Set.Set Id)
{ classMap = Map.empty
, typeMap = Map.empty
, localTypeVars = Map.empty
, assumps = Map.empty
, localVars = Map.empty
, preIds = (emptyPrecMap, Set.empty)
isSingleton :: Set.Set a -> Bool
isSingleton s = Set.size s == 1
hasMany :: Set.Set a -> Bool
hasMany s = Set.size s > 1
addDiags :: [Diagnosis] -> State.State Env ()
e <- State.get
State.put $ e {envDiags = reverse ds ++ envDiags e}
appendSentences :: [Named Sentence] -> State.State Env ()
e <- State.get
State.put $ e {sentences = reverse fs ++ sentences e}
putClassMap :: ClassMap -> State.State Env ()
e <- State.get
State.put e { classMap = ce }
e <- State.get
State.put e { localVars = vs }
fromResult :: (Env -> Result a) -> State.State Env (Maybe a)
e <- State.get
putLocalTypeVars :: LocalTypeVars -> State.State Env ()
e <- State.get
State.put e { localTypeVars = tvs }
putTypeMap :: TypeMap -> State.State Env ()
e <- State.get
State.put e { typeMap = tm }
putAssumps :: Assumps -> State.State Env ()
e <- State.get
State.put e { assumps = ops }
checkUniqueVars :: [VarDecl] -> State.State Env ()
type FunMap = Map.Map (Id, TypeScheme) (Id, TypeScheme)
, typeIdMap = Map.empty
, funMap = Map.empty }
type SymbolMap = Map.Map Symbol Symbol
type SymbolSet = Set.Set Symbol
type RawSymbolMap = Map.Map RawSymbol RawSymbol