This articlemay need to be rewritten to comply with Wikipedia'squality standards.You can help. Thetalk page may contain suggestions.(July 2014) |
Incomputer science,control-flow analysis (CFA) is astatic-code-analysis technique for determining thecontrol flow of a program. The control flow is expressed as acontrol-flow graph (CFG). For bothfunctional programming languages andobject-oriented programming languages, the term CFA, and elaborations such ask-CFA, refer to specific algorithms that compute control flow.[dubious –discuss]
For manyimperative programming languages, the control flow of a program is explicit in a program's source code.[dubious –discuss] As a result,interprocedural control-flow analysis implicitly usually refers to astatic analysis technique for determining the receivers of function or method calls in computer programs written in ahigher-order programming language.[dubious –discuss] For example, in a programming language withhigher-order functions likeScheme, the target of a function call may not be explicit: in the isolated expression
(lambda(f)(fx))
it is unclear to which proceduref may refer. A control-flow analysis must consider where this expression could be invoked and what argument it may receive to determine the possible targets.
Techniques such asabstract interpretation,constraint solving, andtype systems may be used for control-flow analysis.[1][page needed]