ocamlgraph icon indicating copy to clipboard operation
ocamlgraph copied to clipboard

idom_to_dom returns incorrect answer when called on the same node.

Open 2over12 opened this issue 5 years ago • 0 comments

idom_to_dom idom x x will return false despite the fact that a node should always dominate itself.

The problem area is here: let rec idom_to_dom idom x y = try let d = idom y in G.V.equal x d || idom_to_dom idom x d with Not_found -> false The idom of a node is defined as a strict dominator so d will never be equal to y. Therefore in the case that x=y, d will never be equal to x. Thus idom_to_dom of the same node will return false instead of the expected value: true.

2over12 avatar Sep 21 '20 00:09 2over12