Search in sources :

Example 1 with DenseIntegerSet

use of com.dat3m.dartagnan.solver.caat.misc.DenseIntegerSet in project Dat3M by hernanponcedeleon.

the class AcyclicityConstraint method strongConnect.

private void strongConnect(Node v) {
    v.index = index;
    v.lowlink = index;
    stack.push(v);
    v.isOnStack = true;
    index++;
    for (Edge e : constrainedGraph.outEdges(v.id)) {
        Node w = nodeMap[e.getSecond()];
        if (!w.wasVisited()) {
            strongConnect(w);
            v.lowlink = Math.min(v.lowlink, w.lowlink);
        } else if (w.isOnStack) {
            v.lowlink = Math.min(v.lowlink, w.index);
        }
        if (w == v) {
            v.hasSelfLoop = true;
        }
    }
    if (v.lowlink == v.index) {
        Node w;
        do {
            w = stack.pop();
            w.isOnStack = false;
            TEMP_LIST.add(w.id);
        } while (w != v);
        if (v.hasSelfLoop || TEMP_LIST.size() > 1) {
            DenseIntegerSet scc = SET_COLLECTION_POOL.get();
            scc.ensureCapacity(domain.size());
            scc.clear();
            scc.addAll(TEMP_LIST);
            violatingSccs.add(scc);
        }
        TEMP_LIST.clear();
    }
}
Also used : DenseIntegerSet(com.dat3m.dartagnan.solver.caat.misc.DenseIntegerSet) Edge(com.dat3m.dartagnan.solver.caat.predicates.relationGraphs.Edge)

Aggregations

DenseIntegerSet (com.dat3m.dartagnan.solver.caat.misc.DenseIntegerSet)1 Edge (com.dat3m.dartagnan.solver.caat.predicates.relationGraphs.Edge)1