请输入您要查询的百科知识:

 

词条 Dominator (graph theory)
释义

  1. History

  2. Applications

  3. Algorithms

  4. Postdominance

  5. See also

  6. References

  7. External links

{{distinguish|dominating set}}
1 dom     #c0c0c0|1}}#F00000|2}} 3 4 5 6
2 dom #c0c0c0|2}}#F00000|3}}#F00000|4}} 5 #F00000|6}}
3 dom #c0c0c0|3}}
4 dom #c0c0c0|4}}
5 dom #c0c0c0|5}}
6 dom #c0c0c0|6}}
Corresponding domination relation
{{color|#c0c0c0|Grey nodes}} are not strictly dominated
{{color|#F00000|Red nodes}} are immediately dominated

In computer science, in control flow graphs, a node d dominates a node n if every path from the entry node to n must go through d. Notationally, this is written as d dom n (or sometimes d n). By definition, every node dominates itself.

There are a number of related concepts:

  • A node d strictly dominates a node n if d dominates n and d does not equal n.
  • The immediate dominator or idom of a node n is the unique node that strictly dominates n but does not strictly dominate any other node that strictly dominates n. Every node, except the entry node, has an immediate dominator.[1]
  • The dominance frontier of a node d is the set of all nodes n such that d dominates an immediate predecessor of n, but d does not strictly dominate n. It is the set of nodes where ds dominance stops.
  • A dominator tree is a tree where each node's children are those nodes it immediately dominates. Because the immediate dominator is unique, it is a tree. The start node is the root of the tree.

History

Dominance was first introduced by Reese T. Prosser in a 1959 paper on analysis of flow diagrams.[1] Prosser did not present an algorithm for computing dominance, which had to wait ten years for Edward S. Lowry and C. W. Medlock.[2] Ron Cytron et al. rekindled interest in dominance in 1989 when they applied it to the problem of efficiently computing the placement of φ functions, which are used in static single assignment form.[3]

Applications

Dominators, and dominance frontiers particularly, have applications in compilers for computing static single assignment form. A number of compiler optimizations can also benefit from dominators. The flow graph in this case comprises basic blocks.

Automatic parallelization benefits from postdominance frontiers. This is an efficient method of computing control dependence, which is critical to the analysis.

Memory usage analysis can benefit from the dominator tree to easily find leaks and identify high memory usage.[4]

In hardware systems, dominators are used for computing signal probabilities for test generation, estimating switching activities for power and noise analysis, and selecting cut points in equivalence checking.[5]

In software systems, they are used for reducing the size of the test set in structural testing techniques such as statement and branch coverage.[6]

Algorithms

The dominators of a node n are given by the maximal solution to the following data-flow equations:

where is the start node.

The dominator of the start node is the start node itself. The set of dominators for any other node n is the intersection of the set of dominators for all predecessors p of n. The node n is also in the set of dominators for n.

An algorithm for direct solution is:

  // dominator of the start node is the start itself  Dom(n0) = {n0}  // for all other nodes, set all nodes as the dominators  '''for each''' n '''in''' N - {n0}      Dom(n) = N;  // iteratively eliminate nodes that are not dominators  '''while''' changes in any Dom(n)      '''for each''' n '''in''' N - {n0}:          Dom(n) = {n} union with intersection over Dom(p) for all p in pred(n)

Direct solution is quadratic in the number of nodes, or O(n2). Lengauer and Tarjan developed an algorithm which is almost linear,[7] and in practice, except for a few artificial graphs, the algorithm and a simplified version of it are as fast or faster than any other known algorithm for graphs of all sizes and its advantage increases with graph size.[8]

Keith D. Cooper, Timothy J. Harvey, and Ken Kennedy of Rice University describe an algorithm that essentially solves the above data flow equations but uses well engineered data structures to improve performance.[9]

Postdominance

Analogous to the definition of dominance above, a node z is said to post-dominate a node n if all paths to the exit node of the graph starting at n must go through z. Similarly, the immediate post-dominator of a node n is the postdominator of n that doesn't strictly postdominate any other strict postdominators of n.

See also

  • Control flow graph
  • Interval (graph theory)
  • Static single assignment form

References

1. ^{{cite journal |last=Prosser |first=Reese T. |title=Applications of Boolean matrices to the analysis of flow diagrams |url=http://portal.acm.org/ft_gateway.cfm?id=1460314&type=pdf&coll=GUIDE&dl=GUIDE&CFID=79528182&CFTOKEN=33765747 |journal=AFIPS Joint Computer Conferences: Papers Presented at the December 1–3, 1959, Eastern Joint IRE-AIEE-ACM Computer Conference |pages=133–138 |year=1959 |doi=10.1145/1460299.1460314 |series=IRE-AIEE-ACM '59 (Eastern) }}
2. ^{{cite journal |title=Object code optimization |journal=Communications of the ACM |volume=12 |issue=1 |date=January 1969 |pages=13–22 |first=Edward S. |last=Lowry |author2=Medlock, Cleburne W.|doi=10.1145/362835.362838}}
3. ^{{cite journal |first=Ron |last=Cytron |author2=Hind, Michael |author3= Hsieh, Wilson |citeseerx = 10.1.1.50.9287 |title=Automatic Generation of DAG Parallelism |journal=Proceedings of the ACM SIGPLAN 89 Conference on Programming Language Design and Implementation |year=1989 |pages=54–68 }}
4. ^{{cite web |url=http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.mat.ui.help%2Fconcepts%2Fdominatortree.html |title=Dominator Tree |author= |origyear=2008|year=2012 |website=eclipse.org |publisher=SAP AG and IBM Corporation |accessdate=21 June 2013 }}
5. ^{{cite book |last=Teslenko |first=Maxim |author2=Dubrova, Elena |title=An Efficient Algorithm for Finding Double-Vertex Dominators in Circuit Graphs|url=http://dl.acm.org/citation.cfm?id=1049138|journal=Proceedings of Design and Test in Europe Conference |pages=406–411 |year=2005 |doi=10.1109/DATE.2005.53 |isbn=9780769522883 |series=Date '05 |citeseerx=10.1.1.598.3053 }}
6. ^{{cite book |last=Dubrova |first=Elena |title=Structural Testing Based on Minimum Kernels|url=http://dl.acm.org/citation.cfm?id=1049294|journal=Proceedings of Design and Test in Europe Conference |pages=1168–1173 |year=2005 |doi=10.1109/DATE.2005.284 |isbn=9780769522883 |series=Date '05 |citeseerx=10.1.1.583.5547 }}
7. ^{{cite journal |title=A fast algorithm for finding dominators in a flowgraph |journal=ACM Transactions on Programming Languages and Systems |volume=1|issue=1 |date=July 1979 |pages=121–141 |first=Thomas |last=Lengauer |author2=and Tarjan |author3=Robert Endre |doi=10.1145/357062.357071|citeseerx=10.1.1.117.8843 }}
8. ^{{cite web |title=Finding Dominators in Practice |url=http://jgaa.info/accepted/2006/GeorgiadisTarjanWerneck2006.10.1.pdf |author1=Georgiadis, Loukas |author2=Tarjan, Robert E. |author3=Werneck, Renato F. |year=2006}}
9. ^{{cite web |title=A Simple, Fast Dominance Algorithm |url=http://www.hipersoft.rice.edu/grads/publications/dom14.pdf |author1=Cooper, Keith D. |author2=Harvey, Timothy J |author3=Kennedy, Ken |year=2001 }}

External links

  • The Machine-SUIF Control Flow Analysis Library
{{Graph Theory-footer}}{{DEFAULTSORT:Dominator (Graph Theory)}}

2 : Graph theory|Compiler construction

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/9/25 6:30:58