* @throws ErrorSyntax if the signature has two or more multiplicities
* @throws ErrorType if parents only contains NONE
*/
public SubsetSig(String label, Collection<Sig> parents, Attr... attributes) throws Err {
super(getType(label,parents), label, Util.append(attributes, Attr.SUBSET));
if (isEnum!=null) throw new ErrorType(pos, "Subset signature cannot be an enum.");
boolean exact = false;
for(Attr a: attributes) if (a!=null && a.type==AttrType.EXACT) exact = true;
this.exact = exact;
TempList<Sig> temp = new TempList<Sig>(parents==null ? 1 : parents.size());
if (parents==null || parents.size()==0) {
temp.add(UNIV);
} else {
for(Sig parent:parents) {
if (!Version.experimental) {
if (parent==SIGINT) throw new ErrorSyntax(pos, "sig "+label+" cannot be a subset of the builtin \"Int\" signature");
if (parent==SEQIDX) throw new ErrorSyntax(pos, "sig "+label+" cannot be a subset of the builtin \"seq/Int\" signature");
if (parent==STRING) throw new ErrorSyntax(pos, "sig "+label+" cannot be a subset of the builtin \"String\" signature");
}
if (parent==Sig.UNIV) {temp.clear(); temp.add(UNIV); break;}
if (parent!=Sig.NONE && !temp.contains(parent)) temp.add(parent);
}
}
if (temp.size()==0) throw new ErrorType(pos, "Sig "+label+" must have at least one non-empty parent.");
this.parents = temp.makeConst();
}