Package kodkod.ast

Examples of kodkod.ast.Expression.one()


    /** Helper method that returns the constraint that the sig has exactly "n" elements, or at most "n" elements */
    private Formula size(Sig sig, int n, boolean exact) {
        Expression a = sol.a2k(sig);
        if (n<=0) return a.no();
        if (n==1) return exact ? a.one() : a.lone();
        Formula f = exact ? Formula.TRUE : null;
        Decls d = null;
        Expression sum = null;
        while(n>0) {
           n--;
View Full Code Here


            Expression exp = sol.a2k(s);
            TupleSet upper = sol.query(true,exp,false), lower=sol.query(false,exp,false);
            final int n = sc.sig2scope(s);
            if (s.isOne!=null && (lower.size()!=1 || upper.size()!=1)) {
                rep.bound("Sig "+s+" in "+upper+" with size==1\n");
                sol.addFormula(exp.one(), s.isOne);
                continue;
            }
            if (s.isSome!=null && lower.size()<1) sol.addFormula(exp.some(), s.isSome);
            if (s.isLone!=null && upper.size()>1) sol.addFormula(exp.lone(), s.isLone);
            if (n<0) continue; // This means no scope was specified
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.