AnalysisArchitecture.hs revision 98890889ffb2e8f6f722b00e265a211f13b5a861
8a0678903b06fbd3c9acf4f4cd137482e1dcd2aaMatthias TristlModule : $Header$
8a0678903b06fbd3c9acf4f4cd137482e1dcd2aaMatthias TristlDescription : static analysis of CASL architectural specifications
8a0678903b06fbd3c9acf4f4cd137482e1dcd2aaMatthias TristlCopyright : (c) Maciek Makowski, Warsaw University, C. Maeder 2004-2006
8a0678903b06fbd3c9acf4f4cd137482e1dcd2aaMatthias Tristl Mihai Codescu, DFKI GmbH Bremen 2010
8a0678903b06fbd3c9acf4f4cd137482e1dcd2aaMatthias TristlLicense : GPLv2 or higher, see LICENSE.txt
8a0678903b06fbd3c9acf4f4cd137482e1dcd2aaMatthias TristlMaintainer : till@informatik.uni-bremen.de
8a0678903b06fbd3c9acf4f4cd137482e1dcd2aaMatthias TristlStability : provisional
8a0678903b06fbd3c9acf4f4cd137482e1dcd2aaMatthias TristlPortability : non-portable (via imports)
8a0678903b06fbd3c9acf4f4cd137482e1dcd2aaMatthias TristlStatic analysis of CASL architectural specifications
8a0678903b06fbd3c9acf4f4cd137482e1dcd2aaMatthias Tristl Follows the extended static semantics sketched in Chap. III:5.6
8a0678903b06fbd3c9acf4f4cd137482e1dcd2aaMatthias Tristl of the CASL Reference Manual.
module Static.AnalysisArchitecture
import Driver.Options
import Logic.Logic
import Logic.ExtSign
import Logic.Coerce
import Logic.Grothendieck
import Static.GTheory
import Static.DevGraph
import Static.ArchDiagram
import Static.AnalysisStructured
import Syntax.Print_AS_Architecture ()
import Syntax.AS_Architecture
import Syntax.AS_Structured
import Common.AS_Annotation
import Common.Id
import Common.LibName
import Common.Result
import Common.Amalgamate
import Common.DocUtils
import qualified Data.Map as Map
import Data.Maybe
import Data.Graph.Inductive.Graph as Graph (Node)
import Control.Monad (foldM)
rNodes = -- trace (show $ Map.elems branchMap)$
map refSource $ Map.elems branchMap
n0 = Map.findWithDefault (error "copy") n g
Map.map (mapRTNodes g) f)
n0 = Map.findWithDefault (error "copy") n g
Map.map (mapRTNodes g) f)
-> Result (Map.Map SIMPLE_ID RTPointer, ExtStUnitCtx,
anaUnitDeclDefns' lgraph ln dg opts sharedCtx Map.empty
-> HetcatsOpts -> ExtStUnitCtx -> Map.Map SIMPLE_ID RTPointer
-> Result (Map.Map SIMPLE_ID RTPointer, ExtStUnitCtx,
uctx' (Map.union rNodes1 rNodes) udds
alreadyDefinedUnit u = "Unit " ++ tokStr u ++ " already declared/defined"
-> Result (Map.Map SIMPLE_ID RTPointer, ExtStUnitCtx, DGraph, UNIT_DECL_DEFN)
if Map.member un buc
then plain_error (Map.empty, uctx, dg'', ud')
return (Map.fromList [(un, getPointerFromRef rsig)],
(Map.insert un basedParUSig buc, diag'''),
if Map.member un buc then
plain_error (Map.empty, uctx, dg'', ud')
{- we can use Map.insert as there are no mappings for
return (Map.empty,
(Map.insert un bsig buc, diag),
Just (RTLeaves f) -> Just $ Map.findWithDefault
buc' = Map.insert un (Based_unit_sig dnsig rsig) buc0
if Map.member un buc
(EmptyNode $ error "Static.AnalysisArchitecture")
anaUnitDeclDefns' lgraph ln dg opts uctx Map.empty udds
Map.lookup un buc of
return (dgr', uref' : rList , Map.insert n rs cx,
Map.insert n (getPointerFromRef rs) ps)