private static bool IsExternStatement(DoStatement loop, Statement block, Statement stat) { foreach (StatEdge edge in stat.GetAllSuccessorEdges()) { if (loop.ContainsStatement(edge.GetDestination()) && !block.ContainsStatement(edge .GetDestination())) { return(false); } } foreach (Statement st in stat.GetStats()) { if (!IsExternStatement(loop, block, st)) { return(false); } } return(true); }