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

Examples of edu.mit.csail.sdg.alloy4compiler.ast.Sig.SubsetSig


        } else {
           for(Expr choice:choices)
              if (choice instanceof SubsetSig && ((Sig)choice).label.equals(label) && sameset(parents, ((SubsetSig)choice).parents))
                 { ans=(Sig)choice; choices.remove(choice); break; }
           if (ans==null) {
              ans = new SubsetSig(label, parents, isExact, isLone, isOne, isSome, isPrivate, isMeta);
              allsigs.add(ans);
           }
        }
        id2sig.put(id, ans);
        expr2ts.put(ans, ts);
View Full Code Here


          for(Sig s: world.getAllReachableSigs()) if (!s.builtin) {
             if (s.isLone!=null && !(visit(s).longsize()<=1)) return "There can be at most one "+s;
             if (s.isOne !=null && !(visit(s).longsize()==1)) return "There must be exactly one "+s;
             if (s.isSome!=null && !(visit(s).longsize()>=1)) return "There must be at least one "+s;
             if (s instanceof SubsetSig) {
                SubsetSig p = (SubsetSig)s;
                Expr sum = null;
                for(Sig par: p.parents) sum = par.plus(sum);
                if (p.exact) {
                   if (!equal(s, sum)) return "Sig "+s+" must be equal to the union of its parents "+p.parents;
                } else {
View Full Code Here

      attributes = Util.append(attributes, exact ? Attr.EXACT : null);
      if (subset!=null) {
         attributes = Util.append(attributes, SUBSET.makenull(subset));
         List<Sig> newParents = new ArrayList<Sig>(parents==null ? 0 : parents.size());
         if (parents!=null) for(ExprVar p: parents) newParents.add(new PrimSig(p.label, WHERE.make(p.pos)));
         obj = new SubsetSig(full, newParents, attributes);
      } else {
         attributes = Util.append(attributes, SUBSIG.makenull(subsig));
         PrimSig newParent = (parents!=null && parents.size()>0) ? (new PrimSig(parents.get(0).label, WHERE.make(parents.get(0).pos))) : UNIV;
         obj = new PrimSig(full, newParent, attributes);
      }
View Full Code Here

         for(Sig n: ((SubsetSig)oldS).parents) {
            Sig parentAST = u.getRawSIG(n.pos, n.label);
            if (parentAST==null) throw new ErrorSyntax(n.pos, "The sig \""+n.label+"\" cannot be found.");
            parents.add(resolveSig(res, topo, parentAST));
         }
         realSig = new SubsetSig(fullname, parents, oldS.attributes.toArray(new Attr[0]));
      } else {
         Sig sup = ((PrimSig)oldS).parent;
         Sig parentAST = u.getRawSIG(sup.pos, sup.label);
         if (parentAST==null) throw new ErrorSyntax(sup.pos, "The sig \""+sup.label+"\" cannot be found.");
         Sig parent = resolveSig(res, topo, parentAST);
View Full Code Here

TOP

Related Classes of edu.mit.csail.sdg.alloy4compiler.ast.Sig.SubsetSig

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.