Package edu.mit.csail.sdg.alloy4compiler.translator

Examples of edu.mit.csail.sdg.alloy4compiler.translator.A4Tuple.arity()


      if (val instanceof String) return "<html> <span" + c + encode((String)val) + "</span></html>";
      if (val instanceof Pair) return "<html> <b" + c + "field " + encode(((ExprHasName)(((Pair<?,?>)val).b)).label) + "</b></html>";
      if (val instanceof A4Tuple) {
         StringBuilder sb = new StringBuilder("<html> <span" + c);
         A4Tuple tp = (A4Tuple) val;
         for(int i=1; i<tp.arity(); i++) {
            if (i>1) sb.append(" -> ");
            sb.append(encode(tp.atom(i)));
         }
         sb.append("</span></html>");
         return sb.toString();
View Full Code Here


            for(A4Tuple tuple: (A4TupleSet) (instance.eval(rel))) if (tuple.atom(0).equals(atom)) {
               if (tuple.arity()==2) ans.add(tuple.atom(1)); else ans.add(tuple);
            }
         } else if (parent instanceof A4Tuple) {
            A4Tuple tp = (A4Tuple)parent;
            for(int i=1; i<tp.arity(); i++) if (!ans.contains(tp.atom(i))) ans.add(tp.atom(i));
            return ans; // we don't want to sort this; we want the original order
         }
         Collections.sort(ans, new Comparator<Object>() {
            public int compare(Object a, Object b) {
               String t1, t2;
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.