definition:
|
getAllFunctions :: Options -> [CFuncDecl] -> [CurryProg] -> [QName]
-> IO (Options, [CurryProg], [CFuncDecl])
getAllFunctions opts currfuncs currmods [] = return (opts, currmods, currfuncs)
getAllFunctions opts currfuncs currmods (newfun:newfuncs)
| newfun `elem` standardConstructors ++ map funcName currfuncs
|| isPrimFunc opts newfun
= getAllFunctions opts currfuncs currmods newfuncs
| null (fst newfun) -- local declarations have empty module qualifier
= getAllFunctions opts currfuncs currmods newfuncs
| fst newfun `elem` map progName currmods
= maybe
(-- if we don't find the qname, it must be a constructor:
getAllFunctions opts currfuncs currmods newfuncs)
(\fdecl -> getAllFunctions opts
(if null (funcRules fdecl)
then currfuncs -- ignore external functions
else fdecl : currfuncs)
currmods (newfuncs ++ nub (funcsOfCFuncDecl fdecl)))
(find (\fd -> funcName fd == newfun)
(functions
(fromJust (find (\m -> progName m == fst newfun) currmods))))
| otherwise -- we must load a new module
= do let mname = fst newfun
when (optVerb opts > 0) $
putStrLn $ "Loading module '" ++ mname ++ "'..."
newmod <- readCurry mname
when (optVerb opts > 0) $
putStrLn $ "Analyzing module '" ++ mname ++ "'..."
pdetinfo <- analyzeGeneric nondetAnalysis mname
>>= return . either id error
pcmpinfo <- analyzeGeneric patCompAnalysis mname
>>= return . either id error
getAllFunctions
opts { detInfos = combineProgInfo (detInfos opts) pdetinfo
, patInfos = combineProgInfo (patInfos opts) pcmpinfo }
currfuncs (newmod:currmods) (newfun:newfuncs)
|
demand:
|
argument 4
|
deterministic:
|
deterministic operation
|
documentation:
|
Extract all functions that might be called by a given function.
|
indeterministic:
|
might be indeterministic
|
infix:
|
no fixity defined
|
iotype:
|
{(_,_,_,{[]}) |-> _ || (_,_,_,{:}) |-> _}
|
name:
|
getAllFunctions
|
precedence:
|
no precedence defined
|
result-values:
|
_
|
signature:
|
VerifyOptions.Options -> [AbstractCurry.Types.CFuncDecl]
-> [AbstractCurry.Types.CurryProg] -> [(String, String)]
-> Prelude.IO (VerifyOptions.Options, [AbstractCurry.Types.CurryProg], [AbstractCurry.Types.CFuncDecl])
|
solution-complete:
|
operation might suspend on free variables
|
terminating:
|
possibly non-terminating
|
totally-defined:
|
possibly non-reducible on same data term
|