Examples of oneOf()


Examples of kodkod.ast.Variable.oneOf()

        Decls d = null;
        Expression sum = null;
        while(n>0) {
           n--;
           Variable v = Variable.unary("");
           kodkod.ast.Decl dd = v.oneOf(a);
           if (d==null) d=dd; else d=dd.and(d);
           if (sum==null) sum=v; else { if (f!=null) f=v.intersection(sum).no().and(f); sum=v.union(sum); }
        }
        if (f!=null) return sum.eq(a).and(f).forSome(d); else return a.no().or(sum.eq(a).forSome(d));
    }
View Full Code Here

Examples of kodkod.ast.Variable.oneOf()

            Formula f2 = next.join(first).no(); // first element has no predecessor
            Variable e = Variable.unary("");
            Formula f3 = e.eq(first).or(next.join(e).one()); // each element (except the first) has one predecessor
            Formula f4 = e.eq(elem.difference(next.join(elem))).or(e.join(next).one()); // each element (except the last) has one successor
            Formula f5 = e.in(e.join(next.closure())).not(); // there are no cycles
            return k2pos(f3.and(f4).and(f5).forAll(e.oneOf(elem)).and(f1).and(f2), x);
        }
        // This says  no(a&b) and no((a+b)&c) and no((a+b+c)&d)...
        // Emperically this seems to be more efficient than "no(a&b) and no(a&c) and no(b&c)"
        Formula answer = null;
        Expression a = null;
View Full Code Here

Examples of kodkod.ast.Variable.oneOf()

        Formula ans1, ans2;
        // "R in A ->op B" means for each tuple a in A, there are "op" tuples in r that begins with a.
        Expression atuple=null, ar=r;
        for(int i=a.arity(); i>0; i--) {
           Variable v=Variable.unary("");
           if (a.arity()==1) d=v.oneOf(a); else if (d==null) d=v.oneOf(Relation.UNIV); else d=v.oneOf(Relation.UNIV).and(d);
           ar=v.join(ar);
           if (atuple==null) atuple=v; else atuple=atuple.product(v);
        }
        ans1=isIn(ar, ab.right);
        switch(ab.op) {
View Full Code Here

Examples of kodkod.ast.Variable.oneOf()

        Formula ans1, ans2;
        // "R in A ->op B" means for each tuple a in A, there are "op" tuples in r that begins with a.
        Expression atuple=null, ar=r;
        for(int i=a.arity(); i>0; i--) {
           Variable v=Variable.unary("");
           if (a.arity()==1) d=v.oneOf(a); else if (d==null) d=v.oneOf(Relation.UNIV); else d=v.oneOf(Relation.UNIV).and(d);
           ar=v.join(ar);
           if (atuple==null) atuple=v; else atuple=atuple.product(v);
        }
        ans1=isIn(ar, ab.right);
        switch(ab.op) {
View Full Code Here

Examples of kodkod.ast.Variable.oneOf()

        Formula ans1, ans2;
        // "R in A ->op B" means for each tuple a in A, there are "op" tuples in r that begins with a.
        Expression atuple=null, ar=r;
        for(int i=a.arity(); i>0; i--) {
           Variable v=Variable.unary("");
           if (a.arity()==1) d=v.oneOf(a); else if (d==null) d=v.oneOf(Relation.UNIV); else d=v.oneOf(Relation.UNIV).and(d);
           ar=v.join(ar);
           if (atuple==null) atuple=v; else atuple=atuple.product(v);
        }
        ans1=isIn(ar, ab.right);
        switch(ab.op) {
View Full Code Here

Examples of kodkod.ast.Variable.oneOf()

        ans1=ans1.forAll(d);
        // "R in A op-> B" means for each tuple b in B, there are "op" tuples in r that end with b.
        Expression btuple=null, rb=r;
        for(int i=b.arity(); i>0; i--) {
           Variable v=Variable.unary("");
           if (b.arity()==1) d2=v.oneOf(b); else if (d2==null) d2=v.oneOf(Relation.UNIV); else d2=v.oneOf(Relation.UNIV).and(d2);
           rb=rb.join(v);
           if (btuple==null) btuple=v; else btuple=v.product(btuple);
        }
        ans2=isIn(rb, ab.left);
        switch(ab.op) {
View Full Code Here

Examples of kodkod.ast.Variable.oneOf()

        ans1=ans1.forAll(d);
        // "R in A op-> B" means for each tuple b in B, there are "op" tuples in r that end with b.
        Expression btuple=null, rb=r;
        for(int i=b.arity(); i>0; i--) {
           Variable v=Variable.unary("");
           if (b.arity()==1) d2=v.oneOf(b); else if (d2==null) d2=v.oneOf(Relation.UNIV); else d2=v.oneOf(Relation.UNIV).and(d2);
           rb=rb.join(v);
           if (btuple==null) btuple=v; else btuple=v.product(btuple);
        }
        ans2=isIn(rb, ab.left);
        switch(ab.op) {
View Full Code Here

Examples of kodkod.ast.Variable.oneOf()

        ans1=ans1.forAll(d);
        // "R in A op-> B" means for each tuple b in B, there are "op" tuples in r that end with b.
        Expression btuple=null, rb=r;
        for(int i=b.arity(); i>0; i--) {
           Variable v=Variable.unary("");
           if (b.arity()==1) d2=v.oneOf(b); else if (d2==null) d2=v.oneOf(Relation.UNIV); else d2=v.oneOf(Relation.UNIV).and(d2);
           rb=rb.join(v);
           if (btuple==null) btuple=v; else btuple=v.product(btuple);
        }
        ans2=isIn(rb, ab.left);
        switch(ab.op) {
View Full Code Here

Examples of kodkod.ast.Variable.oneOf()

              newd = v.setOf(dv);
           } else switch(dexexpr.mult()) {
              case SETOF: newd = v.setOf(dv); break;
              case SOMEOF: newd = v.someOf(dv); break;
              case LONEOF: newd = v.loneOf(dv); break;
              default: newd = v.oneOf(dv);
           }
           if (frame!=null) frame.kv2typepos(v, dex.type(), dex.pos);
           if (dd==null) dd = newd; else dd = dd.and(newd);
        }
      }
View Full Code Here

Examples of org.jmock.Expectations.oneOf()

        final PackageFeed packageFeed = createPackageFeed("FirstFeed", createPackageEntry("id", "1.2.3"));
        final PackageFeed emptyFeed = createPackageFeed("SecondFeed");
        Expectations expectations = new Expectations();
        expectations.atLeast(0).of(nugetClient).getUrl();
        expectations.will(returnValue(""));
        expectations.oneOf(nugetClient).getPackageCount(expectations.with(false));
        expectations.will(returnValue(1));
        expectations.oneOf(nugetClient).getPackages(
                expectations.with((String) null),
                expectations.with((String) null),
                expectations.with(1),
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.