Examples of atom()


Examples of edu.mit.csail.sdg.alloy4compiler.ast.Type.atom()

                     if (test!=null) nexts.put(t.get(1), test);
                  }
               }
            }
            // Assign atom->name and atom->MostSignificantSig
            for(Tuple t:frame.eval.evaluate(Relation.INTS)) { frame.atom2sig.put(t.atom(0), SIGINT); }
            for(Tuple t:frame.eval.evaluate(KK_SEQIDX))     { frame.atom2sig.put(t.atom(0), SEQIDX); }
            for(Tuple t:frame.eval.evaluate(KK_STRING))     { frame.atom2sig.put(t.atom(0), STRING); }
            for(Sig sig:frame.sigs) if (sig instanceof PrimSig && !sig.builtin && ((PrimSig)sig).isTopLevel()) rename(frame, (PrimSig)sig, nexts, un);
            // These are redundant atoms that were not chosen to be in the final instance
            int unused=0;
View Full Code Here

Examples of edu.mit.csail.sdg.alloy4compiler.ast.Type.atom()

                  }
               }
            }
            // Assign atom->name and atom->MostSignificantSig
            for(Tuple t:frame.eval.evaluate(Relation.INTS)) { frame.atom2sig.put(t.atom(0), SIGINT); }
            for(Tuple t:frame.eval.evaluate(KK_SEQIDX))     { frame.atom2sig.put(t.atom(0), SEQIDX); }
            for(Tuple t:frame.eval.evaluate(KK_STRING))     { frame.atom2sig.put(t.atom(0), STRING); }
            for(Sig sig:frame.sigs) if (sig instanceof PrimSig && !sig.builtin && ((PrimSig)sig).isTopLevel()) rename(frame, (PrimSig)sig, nexts, un);
            // These are redundant atoms that were not chosen to be in the final instance
            int unused=0;
            for(Tuple tuple:frame.eval.evaluate(Relation.UNIV)) {
View Full Code Here

Examples of edu.mit.csail.sdg.alloy4compiler.ast.Type.atom()

               }
            }
            // Assign atom->name and atom->MostSignificantSig
            for(Tuple t:frame.eval.evaluate(Relation.INTS)) { frame.atom2sig.put(t.atom(0), SIGINT); }
            for(Tuple t:frame.eval.evaluate(KK_SEQIDX))     { frame.atom2sig.put(t.atom(0), SEQIDX); }
            for(Tuple t:frame.eval.evaluate(KK_STRING))     { frame.atom2sig.put(t.atom(0), STRING); }
            for(Sig sig:frame.sigs) if (sig instanceof PrimSig && !sig.builtin && ((PrimSig)sig).isTopLevel()) rename(frame, (PrimSig)sig, nexts, un);
            // These are redundant atoms that were not chosen to be in the final instance
            int unused=0;
            for(Tuple tuple:frame.eval.evaluate(Relation.UNIV)) {
               Object atom = tuple.atom(0);
View Full Code Here

Examples of edu.mit.csail.sdg.alloy4compiler.ast.Type.atom()

        for(Tuple t: frame.eval.evaluate(frame.a2k(s))) list.add(t);
        List<Tuple> order = nexts.get(s);
        if (order!=null && order.size()==list.size() && order.containsAll(list)) { list=order; }
        int i = 0;
        for(Tuple t: list) {
           if (frame.atom2sig.containsKey(t.atom(0))) continue; // This means one of the subsig has already claimed this atom.
           String x = signame + "$" + i;
           i++;
           frame.atom2sig.put(t.atom(0), s);
           frame.atom2name.put(t.atom(0), x);
           ExprVar v = ExprVar.make(null, x, s.type());
View Full Code Here

Examples of edu.mit.csail.sdg.alloy4compiler.ast.Type.atom()

        int i = 0;
        for(Tuple t: list) {
           if (frame.atom2sig.containsKey(t.atom(0))) continue; // This means one of the subsig has already claimed this atom.
           String x = signame + "$" + i;
           i++;
           frame.atom2sig.put(t.atom(0), s);
           frame.atom2name.put(t.atom(0), x);
           ExprVar v = ExprVar.make(null, x, s.type());
           TupleSet ts = t.universe().factory().range(t, t);
           Relation r = Relation.unary(x);
           frame.eval.instance().add(r, ts);
View Full Code Here

Examples of edu.mit.csail.sdg.alloy4compiler.ast.Type.atom()

        for(Tuple t: list) {
           if (frame.atom2sig.containsKey(t.atom(0))) continue; // This means one of the subsig has already claimed this atom.
           String x = signame + "$" + i;
           i++;
           frame.atom2sig.put(t.atom(0), s);
           frame.atom2name.put(t.atom(0), x);
           ExprVar v = ExprVar.make(null, x, s.type());
           TupleSet ts = t.universe().factory().range(t, t);
           Relation r = Relation.unary(x);
           frame.eval.instance().add(r, ts);
           frame.a2k.put(v, r);
View Full Code Here

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

      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();
      }
      return "";
View Full Code Here

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

            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

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

            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

Examples of kodkod.instance.Universe.atom()

        this.sol = sol;
        // Figure out the sig bounds
        final Universe universe = factory.universe();
        final int atomN = universe.size();
        final List<Tuple> atoms = new ArrayList<Tuple>(atomN);
        for(int i=atomN-1; i>=0; i--) atoms.add(factory.tuple(universe.atom(i)));
        for(Sig s:sigs) if (!s.builtin && s.isTopLevel()) computeLowerBound(atoms, (PrimSig)s);
        for(Sig s:sigs) if (!s.builtin && s.isTopLevel()) computeUpperBound((PrimSig)s);
        // Bound the sigs
        for(Sig s:sigs) if (!s.builtin && s.isTopLevel()) allocatePrimSig((PrimSig)s);
        for(Sig s:sigs) if (s instanceof SubsetSig) allocateSubsetSig((SubsetSig)s);
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.