Package edu.mit.csail.sdg.alloy4compiler.ast

Examples of edu.mit.csail.sdg.alloy4compiler.ast.ExprUnary


            // Handles possible "binary" or higher-arity multiplicity
            return isInBinary(a, (ExprBinary)b);
        }
        if (b instanceof ExprUnary) {
            // Handles possible "unary" multiplicity
            ExprUnary y = (ExprUnary)b;
            if      (y.op==ExprUnary.Op.EXACTLYOF) { b = y.sub.deNOP(); return a.equals(cset(b)); }
            else if (y.op==ExprUnary.Op.ONEOF)     { b = y.sub.deNOP(); if (!(a.longsize()==1)) return false; }
            else if (y.op==ExprUnary.Op.LONEOF)    { b = y.sub.deNOP(); if (!(a.longsize()<=1)) return false; }
            else if (y.op==ExprUnary.Op.SOMEOF)    { b = y.sub.deNOP(); if (!(a.longsize()>=1)) return false; }
            else if (y.op!=ExprUnary.Op.SETOF)     { b = y.sub.deNOP(); }
View Full Code Here


                }
             }
             for(Expr f: s.getFacts()) {
                if (!cform(f.forAll(s.decl))) {
                   f = f.deNOP(); if (f instanceof ExprUnary) {
                      ExprUnary u = (ExprUnary)f;
                      f = u.sub.deNOP();
                      if (f instanceof ExprBinary) {
                         ExprBinary b = (ExprBinary)f;
                         if (b.op == ExprBinary.Op.JOIN && b.left.isSame(s.decl.get()) && b.right.deNOP() instanceof Field) {
                            String n = ((Field)(b.right.deNOP())).label;
View Full Code Here

     * @return a newly formed multiplciity constraint (if this.op==SOME or LONE or ONE),
     * otherwise it just returns the original node.
     */
    private Expr mult(Expr x) throws Err {
        if (x instanceof ExprUnary) {
           ExprUnary y=(ExprUnary)x;
           if (y.op==ExprUnary.Op.SOME) return ExprUnary.Op.SOMEOF.make(y.pos, y.sub);
           if (y.op==ExprUnary.Op.LONE) return ExprUnary.Op.LONEOF.make(y.pos, y.sub);
           if (y.op==ExprUnary.Op.ONEreturn ExprUnary.Op.ONEOF.make(y.pos, y.sub);
        }
        return x;
View Full Code Here

    //==============================================================================================================//

    /** If ex is a simple combination of Relations, then return that combination, else return null. */
    private Expression sim(Expr ex) {
        while(ex instanceof ExprUnary) {
           ExprUnary u = (ExprUnary)ex;
           if (u.op!=ExprUnary.Op.NOOP && u.op!=ExprUnary.Op.EXACTLYOF) break;
           ex = u.sub;
        }
        if (ex instanceof ExprBinary) {
           ExprBinary b = (ExprBinary)ex;
View Full Code Here

TOP

Related Classes of edu.mit.csail.sdg.alloy4compiler.ast.ExprUnary

Copyright © 2018 www.massapicom. 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.