Package kodkod.ast

Examples of kodkod.ast.Variable.join()


            }
            Formula f1 = elem.in(first.join(next.reflexiveClosure())); // every element is in the total order
            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)"
View Full Code Here


            Formula f1 = elem.in(first.join(next.reflexiveClosure())); // every element is in the total order
            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;
View Full Code Here

        // "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) {
           case ISSEQ_ARROW_LONE:
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.