Package kodkod.instance

Examples of kodkod.instance.TupleSet.removeAll()


     */
    private void computeUpperBound(PrimSig sig) throws Err {
        // Sig's upperbound is fully computed. We recursively compute the upperbound for children...
        TupleSet x = ub.get(sig).clone();
        // We remove atoms that MUST be in a subsig
        for(PrimSig c: sig.children()) x.removeAll(lb.get(c));
        // So now X is the set of atoms that MIGHT be in this sig, but MIGHT NOT be in any particular subsig.
        // For each subsig that may need more atom, we say it could potentionally get any of the atom from X.
        for(PrimSig c: sig.children()) {
           if (sc.sig2scope(c) > lb.get(c).size()) ub.get(c).addAll(x);
           computeUpperBound(c);
View Full Code Here


        if (that==null) return this;
        if (sol != that.sol) throw new ErrorAPI("A4TupleSet.minus() requires 2 tuplesets from the same A4Solution.");
        if (arity() != that.arity()) throw new ErrorAPI("A4TupleSet.minus() requires 2 tuplesets with the same arity.");
        if (tuples.size()==0 || that.tuples.size()==0) return this; // special short cut
        TupleSet ts = tuples.clone();
        ts.removeAll(that.tuples);
        if (tuples.size()!=ts.size()) return new A4TupleSet(ts, sol); else return this;
    }

    /** Construct a new tupleset as the intersection of this and that; this and that must be come from the same solution. */
    public A4TupleSet intersect(A4TupleSet that) throws ErrorAPI {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.