Package kodkod.instance

Examples of kodkod.instance.TupleSet.clone()


        expr2ts.put(ans, ts);
        if (ans instanceof PrimSig) {
           // Add the atoms in this SIG into all parent sigs
           for(PrimSig ans2 = ((PrimSig)ans).parent; ans2!=null && !ans2.builtin; ans2 = ans2.parent) {
              TupleSet ts2 = expr2ts.get(ans2);
              if (ts2==null) ts2 = ts.clone(); else { ts2 = ts2.clone(); ts2.addAll(ts); }
              expr2ts.put(ans2, ts2);
           }
        }
        return ans;
    }
View Full Code Here


       if (expr==Relation.INTS) return makeMutable ? sigintBounds.clone() : sigintBounds;
       if (expr==KK_SEQIDX) return makeMutable ? seqidxBounds.clone() : seqidxBounds;
       if (expr==KK_STRING) return makeMutable ? stringBounds.clone() : stringBounds;
       if (expr instanceof Relation) {
          TupleSet ans = findUpper ? bounds.upperBound((Relation)expr) : bounds.lowerBound((Relation)expr);
          if (ans!=null) return makeMutable ? ans.clone() : ans;
       }
       else if (expr instanceof BinaryExpression) {
          BinaryExpression b = (BinaryExpression)expr;
          if (b.op() == ExprOperator.UNION) {
             TupleSet left = query(findUpper, b.left(), true);
View Full Code Here

                    if (s.isOne!=null) {
                        rel = right(rel);
                        if (!(rel instanceof Relation)) continue;
                        // Retrieve the old value from the previous solution, and convert it to the new unverse.
                        // This should always work since the new universe is not yet solved, and so it should have all possible atoms.
                        TupleSet newLower = convert(factory, s.join(f)), newUpper = newLower.clone();
                        // Bind the partial instance
                        for(Tuple t: sol.query(false, rel, false)) for(int i=0; i<t.arity(); i++) if (!oldAtoms.contains(t.atom(i))) { newLower.add(t); break; }
                        for(Tuple t: sol.query(true, rel, false)) for(int i=0; i<t.arity(); i++) if (!oldAtoms.contains(t.atom(i))) { newUpper.add(t); break; }
                        sol.shrink((Relation)rel, newLower, newUpper);
                    } else {
View Full Code Here

                        sol.shrink((Relation)rel, newLower, newUpper);
                    } else {
                        if (!(rel instanceof Relation)) continue;
                        // Retrieve the old value from the previous solution, and convert it to the new unverse.
                        // This should always work since the new universe is not yet solved, and so it should have all possible atoms.
                        TupleSet newLower = convert(factory, f), newUpper = newLower.clone();
                        // Bind the partial instance
                        for(Tuple t: sol.query(false, rel, false)) for(int i=0; i<t.arity(); i++) if (!oldAtoms.contains(t.atom(i))) { newLower.add(t); break; }
                        for(Tuple t: sol.query(true, rel, false)) for(int i=0; i<t.arity(); i++) if (!oldAtoms.contains(t.atom(i))) { newUpper.add(t); break; }
                        sol.shrink((Relation)rel, newLower, newUpper);
                    }
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.