Commit ff307d79 authored by Michael Hanus 's avatar Michael Hanus
Browse files

Various change for better CASS/CurryBrowser integration

parent e81b585e
......@@ -20,7 +20,8 @@ module Analysis(Analysis(..),
combinedSimpleFuncAnalysis,combinedSimpleTypeAnalysis,
combinedDependencyFuncAnalysis,combinedDependencyTypeAnalysis,
isSimpleAnalysis,isCombinedAnalysis,isFunctionAnalysis,
analysisName,baseAnalysisName,startValue)
analysisName,baseAnalysisName,startValue,
AOutFormat(..))
where
import FlatCurry(ConsDecl,FuncDecl,TypeDecl,QName)
......@@ -29,6 +30,10 @@ import GenericProgInfo(ProgInfo,combineProgInfo,lookupProgInfo)
import LoadAnalysis(loadCompleteAnalysis,getInterfaceInfos)
import CurryFiles(getImports)
--- Datatype representing a program analysis to be used in the
--- generic analysis system. The datatype is abstract so that
--- one has to use one of the constructor operations to create
--- an analysis.
data Analysis a =
SimpleFuncAnalysis String (FuncDecl -> a)
| SimpleTypeAnalysis String (TypeDecl -> a)
......@@ -213,3 +218,14 @@ startValue (DependencyFuncAnalysis _ startval _) = startval
startValue (DependencyTypeAnalysis _ startval _) = startval
startValue (CombinedDependencyFuncAnalysis _ _ _ startval _) = startval
startValue (CombinedDependencyTypeAnalysis _ _ _ startval _) = startval
-------------------------------------------------------------------------
--- The desired kind of output of an analysis result.
--- `AText` denotes a standard textual representation.
--- `ANote` denotes a short note that is empty in case of irrelevant
--- information. For instance, this is used in the CurryBrowser
--- to get a quick overview of the analysis results of all operations
--- in a module.
data AOutFormat = AText | ANote
-------------------------------------------------------------------------
\ No newline at end of file
......@@ -5,7 +5,7 @@
--- registered in the top part of this module.
---
--- @author Heiko Hoffmann, Michael Hanus
--- @version March 2013
--- @version May 2013
--------------------------------------------------------------------
module AnalysisCollection(
......@@ -54,8 +54,8 @@ registeredAnalysis =
,cassAnalysis "Demanded arguments" demandAnalysis showDemand
,cassAnalysis "Higher-order datatypes" hiOrdType showOrder
,cassAnalysis "Higher-order constructors" hiOrdCons showOrder
,cassAnalysis "Higher-order functions" hiOrdFunc show
,cassAnalysis "Sibling constructors" siblingCons show
,cassAnalysis "Higher-order functions" hiOrdFunc showOrder
,cassAnalysis "Sibling constructors" siblingCons showSibling
]
......@@ -68,7 +68,8 @@ registeredAnalysis =
--- by the server/client analysis tool from a given analysis and
--- analysis show function. The first argument is a short title for the
--- analysis.
cassAnalysis :: String -> Analysis a -> (a->String) -> RegisteredAnalysis
cassAnalysis :: String -> Analysis a -> (AOutFormat -> a -> String)
-> RegisteredAnalysis
cassAnalysis title analysis showres =
RegAna (analysisName analysis)
(isFunctionAnalysis analysis)
......@@ -88,7 +89,8 @@ data RegisteredAnalysis =
RegAna String
Bool
String
(String -> [Handle] -> Bool -> IO (Either (ProgInfo String) String))
(String -> [Handle] -> Maybe AOutFormat
-> IO (Either (ProgInfo String) String))
([String] -> IO ())
regAnaName (RegAna n _ _ _ _) = n
......@@ -111,8 +113,8 @@ lookupRegAna aname (ra@(RegAna raname _ _ _ _) : ras) =
if aname==raname then Just ra else lookupRegAna aname ras
-- Look up a registered analysis server with a given analysis name.
lookupRegAnaServer :: String
-> (String -> [Handle] -> Bool -> IO (Either (ProgInfo String) String))
lookupRegAnaServer :: String -> (String -> [Handle] -> Maybe AOutFormat
-> IO (Either (ProgInfo String) String))
lookupRegAnaServer aname =
maybe (\_ _ _ -> return (Right ("unknown analysis: "++aname)))
regAnaServer
......@@ -131,16 +133,16 @@ debugMessage dl message =
--------------------------------------------------------------------
-- Run an analysis with a given name on a given module with a list
-- of workers identified by their handles and return the analysis results.
runAnalysisWithWorkers :: String -> [Handle] -> String
runAnalysisWithWorkers :: String -> AOutFormat -> [Handle] -> String
-> IO (Either (ProgInfo String) String)
runAnalysisWithWorkers ananame handles moduleName =
(lookupRegAnaServer ananame) moduleName handles True
runAnalysisWithWorkers ananame aoutformat handles moduleName =
(lookupRegAnaServer ananame) moduleName handles (Just aoutformat)
-- Run an analysis with a given name on a given module with a list
-- of workers identified by their handles but do not load analysis results.
runAnalysisWithWorkersNoLoad :: String -> [Handle] -> String -> IO ()
runAnalysisWithWorkersNoLoad ananame handles moduleName =
(lookupRegAnaServer ananame) moduleName handles False >> done
(lookupRegAnaServer ananame) moduleName handles Nothing >> done
--- Generic operation to analyze a module.
--- The parameters are the analysis, the show operation for analysis results,
......@@ -149,11 +151,13 @@ runAnalysisWithWorkersNoLoad ananame handles moduleName =
--- and returned (if the flag is false, the result contains the empty
--- program information).
--- An error occurred during the analysis is returned as `(Right ...)`.
analyzeAsString :: Analysis a -> (a->String) -> String -> [Handle] -> Bool
-> IO (Either (ProgInfo String) String)
analyzeAsString analysis showres modname handles load = do
analyzeMain analysis modname handles load >>=
return . either (Left . mapProgInfo showres) Right
analyzeAsString :: Analysis a -> (AOutFormat->a->String) -> String -> [Handle]
-> Maybe AOutFormat -> IO (Either (ProgInfo String) String)
analyzeAsString analysis showres modname handles mbaoutformat = do
analyzeMain analysis modname handles (mbaoutformat /= Nothing) >>=
return . either (Left . mapProgInfo (showres aoutformat)) Right
where
aoutformat = maybe AText id mbaoutformat
--- Generic operation to analyze a module.
--- The parameters are the analysis, the name of the main module
......
......@@ -5,11 +5,12 @@
--- to use the analysis system in another Curry program.
---
--- @author Heiko Hoffmann, Michael Hanus
--- @version April 2013
--- @version May 2013
--------------------------------------------------------------------------
module AnalysisServer(main, analyzeModuleForBrowser, analyzeGeneric,
analyzeInterface) where
module AnalysisServer(main, initializeAnalysisSystem,
analyzeModuleForBrowser, analyzeFunctionForBrowser,
analyzeGeneric, analyzeInterface) where
import ReadNumeric(readNat)
import Char(isSpace)
......@@ -22,8 +23,8 @@ import AnalysisCollection
import ServerFormats
import ServerFunctions(WorkerMessage(..))
import Configuration
import GenericProgInfo(ProgInfo,publicListFromProgInfo)
import Analysis(Analysis)
import GenericProgInfo
import Analysis(Analysis,AOutFormat(..))
-- Messages to communicate with the analysis server from external programs.
data AnalysisServerMessage =
......@@ -39,7 +40,7 @@ data AnalysisServerMessage =
--- Otherwise, it is started in batch mode to analyze a module.
main = do
debugMessageLevel 1 systemBanner
initializeSystem
initializeAnalysisSystem
args <- getArgs
if null args then mainServer Nothing else case args of
["-p",port] -> maybe showError
......@@ -52,14 +53,16 @@ main = do
["--help"] -> showHelp
[ananame,mname] ->
if ananame `elem` registeredAnalysisNames
then analyzeModuleWithOutputFormat ananame mname "Text" True >>= putStrLn
then analyzeModule ananame mname AText >>=
putStrLn . formatResult mname "Text" Nothing True
else showError
_ -> showError
where
showError = error "Illegal arguments (use '--help' for description)"
--- Initializations to be done when the system is started.
initializeSystem = updateRCFile
initializeAnalysisSystem :: IO ()
initializeAnalysisSystem = updateRCFile
showHelp = putStrLn $
"Usage: cass [-p <port>] :\n" ++
......@@ -71,7 +74,7 @@ showHelp = putStrLn $
"Registered analyses names:\n" ++
unlines registeredAnalysisNames
--- Start server on a socket.
--- Start the analysis server on a socket.
mainServer :: Maybe Int -> IO ()
mainServer mbport = do
putStrLn "Start Server"
......@@ -94,37 +97,53 @@ mainServer mbport = do
serverLoop socket1 []
--- Start the analysis system to show the results in the BrowserGUI.
analyzeModuleForBrowser :: String -> String -> IO [(QName,String)]
analyzeModuleForBrowser ananame moduleName = do
initializeSystem
result <- analyzeModuleWithOutputFormat ananame moduleName "CurryTerm" False
return (readQTerm result)
--- Run the analysis system to show the analysis results in the BrowserGUI.
--- Note that, before its first use, the analysis system must be initialized
--- by 'initializeAnalysisSystem'.
analyzeModuleForBrowser :: String -> String -> AOutFormat -> IO [(QName,String)]
analyzeModuleForBrowser ananame moduleName aoutformat =
analyzeModule ananame moduleName aoutformat >>=
return . either pinfo2list (const [])
where
pinfo2list pinfo = let (pubinfo,privinfo) = progInfo2Lists pinfo
in pubinfo++privinfo
--- Run the analysis system to show the analysis result of a single function
--- in the BrowserGUI.
--- Note that before its first use, the analysis system must be initialized
--- by 'initializeAnalysisSystem'.
analyzeFunctionForBrowser :: String -> QName -> AOutFormat -> IO String
analyzeFunctionForBrowser ananame qn@(mname,_) aoutformat = do
analyzeModule ananame mname aoutformat >>=
return . either (maybe "" id . lookupProgInfo qn) (const "")
-- Analyze a complete module where an output format must be specified.
analyzeModuleWithOutputFormat :: String -> String -> String -> Bool -> IO String
analyzeModuleWithOutputFormat ananame moduleName outFormat public = do
--- Analyze a complete module for a given analysis result format.
--- Note that before its first use, the analysis system must be initialized
--- by 'initializeAnalysisSystem'.
analyzeModule :: String -> String -> AOutFormat
-> IO (Either (ProgInfo String) String)
analyzeModule ananame moduleName aoutformat = do
numworkers <- numberOfWorkers
if numworkers>0
then do
serveraddress <- getServerAddress
(port,socket) <- listenOnFresh
handles <- startWorkers numworkers socket serveraddress port []
result <- runAnalysisWithWorkers ananame handles moduleName
result <- runAnalysisWithWorkers ananame aoutformat handles moduleName
stopWorkers handles
sClose socket
return (formatResult moduleName outFormat Nothing public result)
else do
result <- runAnalysisWithWorkers ananame [] moduleName
return (formatResult moduleName outFormat Nothing public result)
return result
else runAnalysisWithWorkers ananame aoutformat [] moduleName
--- Start the analysis system with a particular analysis.
--- The analysis must be a registered one if workers are used.
--- If it is a combined analysis, the base analysis must be also
--- a registered one.
--- Note that, before its first use, the analysis system must be initialized
--- by 'initializeAnalysisSystem'.
analyzeGeneric :: Analysis a -> String -> IO (Either (ProgInfo a) String)
analyzeGeneric analysis moduleName = do
initializeSystem
initializeAnalysisSystem
numworkers <- numberOfWorkers
if numworkers>0
then do
......@@ -143,6 +162,8 @@ analyzeGeneric analysis moduleName = do
--- The analysis must be a registered one if workers are used.
--- If it is a combined analysis, the base analysis must be also
--- a registered one.
--- Note that, before its first use, the analysis system must be initialized
--- by 'initializeAnalysisSystem'.
analyzeInterface :: Analysis a -> String -> IO (Either [(QName,a)] String)
analyzeInterface analysis moduleName = do
analyzeGeneric analysis moduleName
......@@ -218,12 +239,12 @@ serverLoopOnHandle socket1 whandles handle = do
sendServerResult handle showAnalysisNamesAndFormats
serverLoopOnHandle socket1 whandles handle
AnalyzeModule ananame outForm modname public ->
catch (runAnalysisWithWorkers ananame whandles modname >>=
catch (runAnalysisWithWorkers ananame AText whandles modname >>=
return . formatResult modname outForm Nothing public >>=
sendResult)
sendAnalysisError
AnalyzeEntity ananame outForm modname functionName ->
catch (runAnalysisWithWorkers ananame whandles modname >>=
catch (runAnalysisWithWorkers ananame AText whandles modname >>=
return . formatResult modname outForm
(Just functionName) False >>= sendResult)
sendAnalysisError
......
......@@ -6,7 +6,7 @@
--- the analysis server (which is implicitly started if necessary).
---
--- @author Michael Hanus
--- @version April 2013
--- @version May 2013
--------------------------------------------------------------------------
module Configuration
......@@ -27,7 +27,7 @@ import Char(isSpace)
systemBanner =
let bannerText = "CASS: Curry Analysis Server System ("++
"version of 26/04/2013 for "++curryCompiler++")"
"version of 20/05/2013 for "++curryCompiler++")"
bannerLine = take (length bannerText) (repeat '=')
in bannerLine ++ "\n" ++ bannerText ++ "\n" ++ bannerLine
......
-----------------------------------------------------------------------
--- This module provides some operations to deal with Curry/FlatCurry files
--- and their dependencies. of analysis files.
--- and their dependencies.
---
--- @author Michael Hanus
--- @version March 2013
......
......@@ -4,7 +4,7 @@
--- delivers only bottom if some argument is bottom.
---
--- @author Michael Hanus
--- @version April 2013
--- @version May 2013
------------------------------------------------------------------------------
module Demandedness
......@@ -13,15 +13,19 @@ module Demandedness
import Analysis
import FlatCurry
import FlatCurryGoodies
import List((\\))
import List((\\),intercalate)
------------------------------------------------------------------------------
--- Data type to represent determinism information.
type DemandedArgs = [Int]
-- Show determinism information as a string.
showDemand :: DemandedArgs -> String
showDemand = show
showDemand :: AOutFormat -> DemandedArgs -> String
showDemand AText [] = "no demanded arguments"
showDemand ANote [] = ""
showDemand fmt (x:xs) =
(if fmt==AText then "demanded arguments: " else "") ++
intercalate "," (map show (x:xs))
-- Abstract demand domain.
data DemandDomain = Bot | Top
......
......@@ -5,7 +5,7 @@
--- different computation paths.
---
--- @author Michael Hanus
--- @version March 2013
--- @version May 2013
------------------------------------------------------------------------------
module Deterministic(overlapAnalysis,showOverlap,showDet,
......@@ -40,9 +40,10 @@ orInExpr (Case _ e bs) = orInExpr e || any orInBranch bs
orInExpr (Typed e _) = orInExpr e
-- Show overlapping information as a string.
showOverlap :: Bool -> String
showOverlap True = "overlapping"
showOverlap False = "non-overlapping"
showOverlap :: AOutFormat -> Bool -> String
showOverlap _ True = "overlapping"
showOverlap AText False = "non-overlapping"
showOverlap ANote False = ""
------------------------------------------------------------------------------
-- The determinism analysis is a global function dependency analysis.
......@@ -54,9 +55,10 @@ showOverlap False = "non-overlapping"
data Deterministic = NDet | Det
-- Show determinism information as a string.
showDet :: Deterministic -> String
showDet NDet = "nondeterministic"
showDet Det = "deterministic"
showDet :: AOutFormat -> Deterministic -> String
showDet _ NDet = "nondeterministic"
showDet AText Det = "deterministic"
showDet ANote Det = ""
nondetAnalysis :: Analysis Deterministic
nondetAnalysis = dependencyFuncAnalysis "Deterministic" Det nondetFunc
......
......@@ -14,9 +14,9 @@ import GenericProgInfo
data Order = HO | FO
-- Show higher-order information as a string.
showOrder :: Order -> String
showOrder HO = "higher-order"
showOrder FO = "first-order"
showOrder :: AOutFormat -> Order -> String
showOrder _ HO = "higher-order"
showOrder _ FO = "first-order"
hoOr :: Order -> Order -> Order
hoOr HO _ = HO
......
......@@ -30,9 +30,11 @@ indetFunc func calledFuncs =
hasIndetRules func || any snd calledFuncs
-- Show right-linearity information as a string.
showIndet :: Bool -> String
showIndet True = "indeterministic"
showIndet False = ""
showIndet :: AOutFormat -> Bool -> String
showIndet AText True = "impure (indeterministic) operation"
showIndet ANote True = "indeterministic"
showIndet AText False = "referentially transparent operation"
showIndet ANote False = ""
------------------------------------------------------------------------------
-- The right-linearity analysis can also be applied to individual functions.
......
......@@ -30,9 +30,10 @@ rlFunc func calledFuncs =
hasRightLinearRules func && all snd calledFuncs
-- Show right-linearity information as a string.
showRightLinear :: Bool -> String
showRightLinear True = "right-linear"
showRightLinear False = ""
showRightLinear :: AOutFormat -> Bool -> String
showRightLinear _ True = "right-linear"
showRightLinear AText False = "not defined by right-linear rules"
showRightLinear ANote False = ""
------------------------------------------------------------------------------
-- The right-linearity analysis can also be applied to individual functions.
......
......@@ -53,9 +53,9 @@ isFlexExpr (Case ctype e bs) = ctype==Flex &&
isFlexExpr (Typed e _) = isFlexExpr e
-- Show solution completeness information as a string.
showSolComplete :: Bool -> String
showSolComplete True = "solution complete"
showSolComplete False = "maybe suspend"
showSolComplete :: AOutFormat -> Bool -> String
showSolComplete _ True = "solution complete"
showSolComplete _ False = "maybe suspend"
pre n = ("Prelude",n)
......
......@@ -6,10 +6,10 @@
--- constructor terms
---
--- @author Johannes Koj, Michael Hanus
--- @version April 2013
--- @version May 2013
-----------------------------------------------------------------------------
module TotallyDefined(siblingCons,
module TotallyDefined(siblingCons,showSibling,
Completeness(..),showComplete,showTotally,
patCompAnalysis,totalAnalysis) where
......@@ -23,6 +23,11 @@ import List(delete)
--- An analysis to compute the sibling constructors (belonging to the
--- same data type) for a data constructor.
--- Shows the result of the sibling constructors analysis, i.e.,
--- shows a list of constructor names.
showSibling :: AOutFormat -> [QName] -> String
showSibling _ = show
siblingCons :: Analysis [QName]
siblingCons =
simpleConstructorAnalysis "SiblingCons" consNamesOfType
......@@ -59,9 +64,10 @@ analyseTotally pcinfo fdecl calledfuncs =
&& all snd calledfuncs
-- Shows the result of the totally-defined analysis.
showTotally :: Bool -> String
showTotally True = "totally defined"
showTotally False = "partially defined"
showTotally :: AOutFormat -> Bool -> String
showTotally AText True = "totally defined"
showTotally ANote True = ""
showTotally _ False = "partially defined"
------------------------------------------------------------------------------
--- Pattern completeness analysis
......@@ -70,10 +76,11 @@ patCompAnalysis =
combinedSimpleFuncAnalysis "PatComplete" siblingCons analysePatComplete
-- Shows the result of the completeness analysis.
showComplete :: Completeness -> String
showComplete Complete = "complete"
showComplete InComplete = "incomplete"
showComplete InCompleteOr = "incomplete in each disjunction"
showComplete :: AOutFormat -> Completeness -> String
showComplete AText Complete = "complete"
showComplete ANote Complete = ""
showComplete _ InComplete = "incomplete"
showComplete _ InCompleteOr = "incomplete in each disjunction"
analysePatComplete :: ProgInfo [QName] -> FuncDecl -> Completeness
......
---------------------------------------------------------------------------------
-- Definition of the datatypes for the various analyses contained in the browser.
---------------------------------------------------------------------------------
-------------------------------------------------------------------------------
--- Definition of the datatypes for the various analyses contained
--- in the browser.
-------------------------------------------------------------------------------
module AnalysisTypes(FunctionAnalysis(..),AnalysisResult(..),
ModuleAnalysis(..),ModuleAnalysisResult(..),
......@@ -8,7 +9,7 @@ module AnalysisTypes(FunctionAnalysis(..),AnalysisResult(..),
import FlatCurry
-----------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- Types for analyzing functions:
-- Interface of various kinds of function analyses:
data FunctionAnalysis a =
......@@ -19,11 +20,12 @@ data FunctionAnalysis a =
-- The possible results of a function analysis:
data AnalysisResult =
MsgResult String -- a message to be shown in the browser
| ActionResult (IO ()) -- an I/O action to show the result externally
MsgResult String -- a message to be shown in the browser
| ActionResult (IO String) -- an I/O action to compute or visualize
-- the result externally
-----------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- Types for analyzing complete modules:
data ModuleAnalysis a =
InterfaceAnalysis (Prog -> a) -- analysis based on the module interface
......
......@@ -8,6 +8,9 @@
module BrowserAnalysis(moduleAnalyses,allFunctionAnalyses,functionAnalyses) where
import AnalysisTypes
import Analysis(AOutFormat(..))
import AnalysisServer(analyzeFunctionForBrowser)
import AnalysisCollection(functionAnalysisInfos)
import FlatCurry
import FlatCurryGoodies
import FlatCurryShow(showFlatFunc)
......@@ -77,8 +80,10 @@ functionAnalyses =
("Dependency graph (DOT)", withAction (GlobalAnalysis viewFuncDepGraphs)),
("Local dependency graph (DOT)", withAction (GlobalAnalysis viewFuncLocalDepGraphs)),
("Called by", GlobalAnalysis calledBy `showWithMsg`
showDep "Is called by the following functions of the current module:"),
("Overlapping rules",
showDep "Is called by the following functions of the current module:")] ++
map (\ (aname,atitle) -> (atitle++" (CASS)", withCASS aname))
functionAnalysisInfos ++
[("Overlapping rules",
LocalAnalysis isOverlappingFunction `showWithMsg` showOverlap),
("Right-linear rules",
LocalAnalysis hasRightLinearRules `showWithMsg` showLinear),
......@@ -274,21 +279,33 @@ showDGraph (mod,_) isExt fnames =
-- dot attributes for visualization of external function nodes:
extAttrs = [("style","filled"),("color",".7 .3 1.0")]
--------------------------------------------------------------------------------
-- Auxiliary operation to integrate a CASS analysis for an individual
-- operation.
withCASS :: String -> FunctionAnalysis AnalysisResult
withCASS ananame =
LocalAnalysis (\f -> ActionResult (analyzeFunctionWithCASS f))
where
analyzeFunctionWithCASS (Func f _ _ _ _) =
analyzeFunctionForBrowser ananame f AText
--------------------------------------------------------------------------------
-- This function is useful to integrate an existing program analysis
-- with result type (IO a) into the browser by providing a transformation
-- of the analysis results.
withAction :: FunctionAnalysis (IO _) -> FunctionAnalysis AnalysisResult
withAction (LocalAnalysis ana) =
LocalAnalysis (\f -> ActionResult (ana f >> done))
LocalAnalysis (\f -> ActionResult (ana f >> return ""))
withAction (LocalDataAnalysis ana) =
LocalDataAnalysis (\types f -> ActionResult (ana types f >> done))
LocalDataAnalysis (\types f -> ActionResult (ana types f >> return ""))
withAction (GlobalAnalysis ana) =
GlobalAnalysis (\funs -> map (\(name,res)->(name,ActionResult (res >> done)))
(ana funs))
GlobalAnalysis
(\funs -> map (\(name,res) -> (name,ActionResult (res >> return "")))
(ana funs))
withAction (GlobalDataAnalysis ana) =
GlobalDataAnalysis (\types funs -> map (\(name,res)->(name,ActionResult (res>>done)))
(ana types funs))
GlobalDataAnalysis
(\types funs -> map (\ (name,res) -> (name,ActionResult (res>>return "")))
(ana types funs))
-- A simple example for a global function analysis of type IO:
printFuncName :: [FuncDecl] -> [(QName,IO ())]
......
......@@ -30,7 +30,8 @@ import Directory
import Time(toCalendarTime,calendarTimeToString)
import Distribution(installDir,curryCompiler)
import AnalysisServer(analyzeModuleForBrowser)
import Analysis(AOutFormat(..))
import AnalysisServer(initializeAnalysisSystem,analyzeModuleForBrowser)
import AnalysisCollection(functionAnalysisInfos)
---------------------------------------------------------------------
......@@ -61,6 +62,7 @@ main = do
"Usage: currybrowser <module_name>"
start mod = do
initializeAnalysisSystem
putStrLn "Please be patient, reading all interfaces..."
helptxt <- readFile (browserDir++"/README")
mods <- getImportedInterfaces mod
......@@ -596,7 +598,8 @@ browserGUI gstate rmod rtxt names =
showAnalysisResult result gp
showAnalysisResult (MsgResult str) gp = setValue resultwidget str gp
showAnalysisResult (ActionResult act) _ = act
showAnalysisResult (ActionResult act) gp =
act >>= \str -> setValue resultwidget str gp
-- focus on a function if selected:
......@@ -644,11 +647,11 @@ browserGUI gstate rmod rtxt names =
funs <- getFuns gstate
setValue resultwidget explanation gp
showDoing gp "Analyzing..."
results <- analyzeModuleForBrowser analysisName modName
results <- analyzeModuleForBrowser analysisName modName ANote
setConfig rfun
(List (map (\qf -> let info = maybe "?" id (lookup qf results)
in snd qf ++ if null info then ""
else ": "++info)
else " >>> "++info)
(map funcName funs)))
gp
......
......@@ -37,7 +37,7 @@ import List
import System
import Time
import AnalysisServer(analyzeInterface)
import AnalysisServer(initializeAnalysisSystem,analyzeInterface)
import Deterministic
import TotallyDefined
import Indeterministic
......@@ -174,6 +174,7 @@ copyIncludeIfPresent docdir inclfile = do
-- read and generate all analysis infos:
readAnaInfo modname = do
initializeAnalysisSystem
nondet <- analyzeInterface nondetAnalysis modname >>= stopIfError
complete <- analyzeInterface patCompAnalysis modname >>= stopIfError
indet <- analyzeInterface indetAnalysis modname >>= stopIfError
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment