Control-flow Graph
   HOME
*



picture info

Control-flow Graph
In computer science, a control-flow graph (CFG) is a representation, using graph notation, of all paths that might be traversed through a program during its execution. The control-flow graph was discovered by Frances E. Allen, who noted that Reese T. Prosser used boolean connectivity matrices for flow analysis before. The CFG is essential to many compiler optimizations and static-analysis tools. Definition In a control-flow graph each node in the graph represents a basic block, i.e. a straight-line piece of code without any jumps or jump targets; jump targets start a block, and jumps end a block. Directed edges are used to represent jumps in the control flow. There are, in most presentations, two specially designated blocks: the ''entry block'', through which control enters into the flow graph, and the ''exit block'', through which all control flow leaves. Because of its construction procedure, in a CFG, every edge A→B has the property that: : outdegree(A) > 1 or inde ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  




Some Types Of Control Flow Graphs
Some may refer to: *''some'', an English word used as a determiner and pronoun; see use of ''some'' *The term associated with the existential quantifier *"Some", a song by Built to Spill from their 1994 album ''There's Nothing Wrong with Love'' *Socialist-oriented market economy, the Vietnamese economic system occasionally abbreviated SOME *Social market economy, the German socioeconomic model abbreviated SOME *So Others Might Eat (SOME), a Washington, D.C.-based non-profit organization *SoMe, short for social media * ''Some'' (film), a 24 film * "Some" (song), a duet by Junggigo and Soyou *Some & Any Some & Any was a German pop duo, formed during the eighth season of the German television talent show '' Popstars''. The group consisted of then-18-year-old Vanessa Meisinger and 20-year-old half-Brazilian, half-Swiss Leonardo Ritzmann. The seas ...
, German pop duo {{disambig ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


picture info

Outdegree
In mathematics, and more specifically in graph theory, a directed graph (or digraph) is a graph that is made up of a set of vertices connected by directed edges, often called arcs. Definition In formal terms, a directed graph is an ordered pair where * ''V'' is a set whose elements are called '' vertices'', ''nodes'', or ''points''; * ''A'' is a set of ordered pairs of vertices, called ''arcs'', ''directed edges'' (sometimes simply ''edges'' with the corresponding set named ''E'' instead of ''A''), ''arrows'', or ''directed lines''. It differs from an ordinary or undirected graph, in that the latter is defined in terms of unordered pairs of vertices, which are usually called ''edges'', ''links'' or ''lines''. The aforementioned definition does not allow a directed graph to have multiple arrows with the same source and target nodes, but some authors consider a broader definition that allows directed graphs to have such multiple arcs (namely, they allow the arc set to be a mul ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


Exception Handling
In computing and computer programming, exception handling is the process of responding to the occurrence of ''exceptions'' – anomalous or exceptional conditions requiring special processing – during the execution of a program. In general, an exception breaks the normal flow of execution and executes a pre-registered ''exception handler''; the details of how this is done depend on whether it is a hardware or software exception and how the software exception is implemented. Exception handling, if provided, is facilitated by specialized programming language constructs, hardware mechanisms like interrupts, or operating system (OS) inter-process communication (IPC) facilities like signals. Some exceptions, especially hardware ones, may be handled so gracefully that execution can resume where it was interrupted. Definition The definition of an exception is based on the observation that each procedure has a precondition, a set of circumstances for which it will terminate "normal ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


picture info

Depth-first Search
Depth-first search (DFS) is an algorithm for traversing or searching tree or graph data structures. The algorithm starts at the root node (selecting some arbitrary node as the root node in the case of a graph) and explores as far as possible along each branch before backtracking. Extra memory, usually a stack, is needed to keep track of the nodes discovered so far along a specified branch which helps in backtracking of the graph. A version of depth-first search was investigated in the 19th century by French mathematician Charles Pierre Trémaux as a strategy for solving mazes. Properties The time and space analysis of DFS differs according to its application area. In theoretical computer science, DFS is typically used to traverse an entire graph, and takes time where , V, is the number of vertices and , E, the number of edges. This is linear in the size of the graph. In these applications it also uses space O(, V, ) in the worst case to store the stack of vertices on th ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


picture info

Lengauer–Tarjan's Algorithm
In computer science, a node of a control-flow graph dominates a node if every path from the ''entry node'' to must go through . Notationally, this is written as (or sometimes ). By definition, every node dominates itself. There are a number of related concepts: * A node ''strictly dominates'' a node if dominates and does not equal . * The ''immediate dominator'' or idom of a node is the unique node that strictly dominates but does not strictly dominate any other node that strictly dominates . Every node, except the entry node, has an immediate dominator. * The ''dominance frontier'' of a node is the set of all nodes such that dominates an immediate predecessor of , but does not strictly dominate . It is the set of nodes where 's dominance stops. * A ''dominator tree'' is a tree where each node's children are those nodes it immediately dominates. The start node is the root of the tree. History Dominance was first introduced by Reese T. Prosser in a 1959 paper ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


picture info

Dominator (graph Theory)
In computer science, a node of a control-flow graph dominates a node if every path from the ''entry node'' to must go through . Notationally, this is written as (or sometimes ). By definition, every node dominates itself. There are a number of related concepts: * A node ''strictly dominates'' a node if dominates and does not equal . * The ''immediate dominator'' or idom of a node is the unique node that strictly dominates but does not strictly dominate any other node that strictly dominates . Every node, except the entry node, has an immediate dominator. * The ''dominance frontier'' of a node is the set of all nodes such that dominates an immediate predecessor of , but does not strictly dominate . It is the set of nodes where 's dominance stops. * A ''dominator tree'' is a tree where each node's children are those nodes it immediately dominates. The start node is the root of the tree. History Dominance was first introduced by Reese T. Prosser in a 1959 paper ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


Jump Threading
In computing, jump threading is a compiler optimization of one jump directly to a second jump. If the second condition is a subset or inverse of the first, it can be eliminated, or threaded through the first jump. This is easily done in a single pass through the program, following acyclic chained jumps until the compiler arrives at a fixed point. Example The following pseudocode demonstrates when a jump may be threaded. 10. a = SomeNumber(); 20. IF a > 10 GOTO 50 ... 50. IF a > 0 GOTO 100 ... The jump on line 50 will always be taken if the jump on line 20 is taken. Therefore, for as long as line 100 is within the reachable range of the jump (or the size of the jump doesn't matter), the jump on line 20 may safely be modified to jump directly to line 100. See also * Switch (programming) * Spaghetti code Spaghetti code is a pejorative phrase for unstructured and difficult-to- maintain source code. Spaghetti code can be caused by several factors, such as volat ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


Halting Problem
In computability theory, the halting problem is the problem of determining, from a description of an arbitrary computer program and an input, whether the program will finish running, or continue to run forever. Alan Turing proved in 1936 that a general algorithm to solve the halting problem for all possible program–input pairs cannot exist. For any program that might determine whether programs halt, a "pathological" program , called with some input, can pass its own source and its input to ''f'' and then specifically do the opposite of what ''f'' predicts ''g'' will do. No ''f'' can exist that handles this case. A key part of the proof is a mathematical definition of a computer and program, which is known as a Turing machine; the halting problem is '' undecidable'' over Turing machines. It is one of the first cases of decision problems proven to be unsolvable. This proof is significant to practical computing efforts, defining a class of applications which no programming inventi ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


Infinite Loop
In computer programming, an infinite loop (or endless loop) is a sequence of instructions that, as written, will continue endlessly, unless an external intervention occurs ("pull the plug"). It may be intentional. Overview This differs from: * "a type of computer program that runs the same instructions continuously until it is either stopped or interrupted." Consider the following pseudocode: how_many = 0 while is_there_more_data() do how_many = how_many + 1 end display "the number of items counted = " how_many ''The same instructions'' were run ''continuously until it was stopped or interrupted'' . . . by the ''FALSE'' returned at some point by the function ''is_there_more_data''. By contrast, the following loop will not end by itself: birds = 1 fish = 2 while birds + fish > 1 do birds = 3 - birds fish = 3 - fish end ''birds'' will alternate being 1 or 2, while ''fish'' will alternate being 2 or 1. The loop will not stop unless an external intervention occur ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


Unreachable Code
In computer programming, unreachable code is part of the source code of a program which can never be executed because there exists no control flow path to the code from the rest of the program. Unreachable code is sometimes also called ''dead code'', although dead code may also refer to code that is executed but has no effect on the output of a program. Unreachable code is generally considered undesirable for several reasons: * It uses memory unnecessarily * It can cause unnecessary use of the CPU's instruction cache ** This can also decrease data locality * Time and effort may be spent testing, maintaining and documenting code which is never used ** Sometimes an automated test is the only thing using the code. However, unreachable code can have some legitimate uses, like providing a library of functions for calling or jumping to manually via a debugger while the program is halted after a breakpoint. This is particularly useful for examining and pretty-printing the internal state ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]