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.