Program: 135883
Project: 135883
Buggy source:
/** 
 * The following was used for debugging.  It might be useful again, so I'm   keeping it here in as a comment.                                         
 */
public final boolean levelCheck(int itr){
  if (this.levelChecked >= itr)   return this.levelCorrect;
  this.levelChecked=itr;
  this.levelCorrect=true;
  for (int i=0; i < this.operands.length; i++) {
    if (this.operands[i] != null && !this.operands[i].levelCheck(itr)) {
      this.levelCorrect=false;
    }
  }
  for (int i=0; i < this.ranges.length; i++) {
    if (this.ranges[i] != null && !this.ranges[i].levelCheck(itr)) {
      this.levelCorrect=false;
    }
  }
  if (this.operator instanceof OpDefNode) {
    OpDefNode opDef=(OpDefNode)this.operator;
    boolean opDefLevelCheck=opDef.levelCheck(itr);
    for (int i=0; i < this.operands.length; i++) {
      ExprOrOpArgNode opd=this.operands[i];
      if (opd != null) {
        if (opd.getLevel() > opDef.getMaxLevel(i)) {
          if (opDefLevelCheck && opd.levelCheck(itr)) {
            errors.addError(this.stn.getLocation(),"String_Node_Str" + opDef.getName() + "String_Node_Str"+ (i + 1)+ "String_Node_Str"+ "String_Node_Str");
          }
          this.levelCorrect=false;
        }
        if (opd instanceof OpArgNode && ((OpArgNode)opd).getOp() instanceof OpDefNode) {
          OpDefNode opdDef=(OpDefNode)((OpArgNode)opd).getOp();
          boolean opdDefLevelCheck=opdDef.levelCheck(itr);
          int alen=opdDef.getArity();
          for (int j=0; j < alen; j++) {
            if (opdDef.getMaxLevel(j) < opDef.getMinMaxLevel(i,j)) {
              if (opDefLevelCheck && opd.levelCheck(itr)) {
                errors.addError(this.stn.getLocation(),"String_Node_Str" + opDef.getName() + "String_Node_Str"+ "String_Node_Str"+ (j + 1)+ "String_Node_Str"+ (i + 1)+ "String_Node_Str"+ opDef.getMinMaxLevel(i,j)+ "String_Node_Str");
              }
              this.levelCorrect=false;
            }
          }
          for (int j=0; j < this.operands.length; j++) {
            for (int k=0; k < alen; k++) {
              if (opDef.getOpLevelCond(i,j,k) && this.operands[j].getLevel() > opdDef.getMaxLevel(k)) {
                if (opd.levelCheck(itr) && this.operands[j].levelCheck(itr)) {
                  errors.addError(this.stn.getLocation(),"String_Node_Str" + opDef.getName() + "String_Node_Str"+ (j + 1)+ "String_Node_Str"+ "String_Node_Str");
                }
                this.levelCorrect=false;
              }
            }
          }
        }
      }
    }
    for (int i=0; i < this.ranges.length; i++) {
      ExprNode range=this.ranges[i];
      if (range != null) {
        boolean rangeLevelCheck=range.levelCheck(itr);
        if (range.getLevel() > ActionLevel) {
          if (rangeLevelCheck) {
            errors.addError(this.stn.getLocation(),"String_Node_Str" + opDef.getName() + "String_Node_Str"+ boundedBoundSymbols[i][0]+ "String_Node_Str"+ "String_Node_Str");
          }
          this.levelCorrect=false;
        }
      }
    }
    this.level=opDef.getLevel();
    for (int i=0; i < this.operands.length; i++) {
      if (this.operands[i] != null && opDef.getWeight(i) == 1) {
        this.level=Math.max(this.level,this.operands[i].getLevel());
      }
    }
    for (int i=0; i < this.ranges.length; i++) {
      this.level=Math.max(this.level,this.ranges[i].getLevel());
    }
    this.levelParams.addAll(opDef.getLevelParams());
    this.allParams.addAll(opDef.getAllParams());
    this.nonLeibnizParams.addAll(opDef.getNonLeibnizParams());
    int ar=opDef.getArity();
    for (int i=0; i < this.operands.length; i++) {
      if (this.operands[i] != null && opDef.getWeight(i) == 1) {
        this.levelParams.addAll(this.operands[i].getLevelParams());
      }
      ;
      if (this.operands[i] != null) {
        this.allParams.addAll(this.operands[i].getAllParams());
        this.nonLeibnizParams.addAll(this.operands[i].getNonLeibnizParams());
      }
      ;
      int ii=i;
      if (ar == -1) {
        ii=0;
      }
      ;
      if (!opDef.isLeibnizArg[ii]) {
        this.nonLeibnizParams.addAll(this.operands[i].getAllParams());
      }
    }
    for (int i=0; i < this.ranges.length; i++) {
      this.levelParams.addAll(this.ranges[i].getLevelParams());
      this.allParams.addAll(this.ranges[i].getAllParams());
      this.nonLeibnizParams.addAll(this.ranges[i].getNonLeibnizParams());
    }
    HashSet allBoundSymbols=new HashSet();
    if (this.unboundedBoundSymbols != null) {
      for (int i=0; i < this.unboundedBoundSymbols.length; i++) {
        allBoundSymbols.add(this.unboundedBoundSymbols[i]);
      }
    }
    ;
    if (this.boundedBoundSymbols != null) {
      for (int i=0; i < this.boundedBoundSymbols.length; i++) {
        if (this.boundedBoundSymbols[i] != null) {
          for (int j=0; j < this.boundedBoundSymbols[i].length; j++) {
            allBoundSymbols.add(this.boundedBoundSymbols[i][j]);
          }
        }
      }
    }
    ;
    Iterator absIter=allBoundSymbols.iterator();
    while (absIter.hasNext()) {
      Object nextBoundSymbol=absIter.next();
      this.levelParams.remove(nextBoundSymbol);
      this.allParams.remove(nextBoundSymbol);
      this.nonLeibnizParams.remove(nextBoundSymbol);
    }
    ;
    this.levelConstraints.putAll(opDef.getLevelConstraints());
    for (int i=0; i < this.operands.length; i++) {
      if (this.operands[i] != null) {
        if (allBoundSymbols.size() == 0) {
          this.levelConstraints.putAll(this.operands[i].getLevelConstraints());
        }
 else {
          SetOfLevelConstraints lcons=this.operands[i].getLevelConstraints();
          Iterator iter=lcons.keySet().iterator();
          while (iter.hasNext()) {
            SymbolNode param=(SymbolNode)iter.next();
            if (!allBoundSymbols.contains(param)) {
              this.levelConstraints.put(param,lcons.get(param));
            }
          }
        }
      }
    }
    for (int i=0; i < this.ranges.length; i++) {
      this.levelConstraints.putAll(this.ranges[i].getLevelConstraints());
    }
    for (int i=0; i < this.operands.length; i++) {
      Integer mlevel=new Integer(opDef.getMaxLevel(i));
      if (this.operands[i] != null) {
        Iterator iter=this.operands[i].getLevelParams().iterator();
        while (iter.hasNext()) {
          this.levelConstraints.put(iter.next(),mlevel);
        }
      }
    }
    for (int i=0; i < this.operands.length; i++) {
      ExprOrOpArgNode opdi=this.operands[i];
      if (opdi != null && opdi instanceof OpArgNode && ((OpArgNode)opdi).getOp() instanceof OpDefNode) {
        OpDefNode argDef=(OpDefNode)((OpArgNode)opdi).getOp();
        argDef.levelCheck(itr);
        int alen=argDef.getArity();
        for (int j=0; j < this.operands.length; j++) {
          for (int k=0; k < alen; k++) {
            if (opDef.getOpLevelCond(i,j,k)) {
              Integer mlevel=new Integer(argDef.getMaxLevel(k));
              Iterator iter=this.operands[j].getLevelParams().iterator();
              while (iter.hasNext()) {
                this.levelConstraints.put(iter.next(),mlevel);
              }
            }
          }
        }
        ;
        if (!argDef.isLeibniz) {
          for (int j=0; j < this.operands.length; j++) {
            for (int k=0; k < alen; k++) {
              if (opDef.getOpLevelCond(i,j,k) && !argDef.isLeibnizArg[k]) {
                this.nonLeibnizParams.addAll(this.operands[j].getAllParams());
              }
            }
          }
          ;
        }
        ;
      }
    }
    HashSet alpSet=opDef.getArgLevelParams();
    Iterator iter=alpSet.iterator();
    while (iter.hasNext()) {
      ArgLevelParam alp=(ArgLevelParam)iter.next();
      ExprOrOpArgNode arg=this.getArg(alp.op);
      if (arg != null && arg instanceof OpArgNode && ((OpArgNode)arg).getOp() instanceof OpDefNode) {
        OpDefNode argDef=(OpDefNode)((OpArgNode)arg).getOp();
        argDef.levelCheck(itr);
        Integer mlevel=new Integer(argDef.getMaxLevel(alp.i));
        this.levelConstraints.put(alp.param,mlevel);
      }
    }
    this.argLevelConstraints.putAll(opDef.getArgLevelConstraints());
    for (int i=0; i < this.operands.length; i++) {
      if (this.operands[i] != null) {
        this.argLevelConstraints.putAll(this.operands[i].getArgLevelConstraints());
      }
    }
    for (int i=0; i < this.ranges.length; i++) {
      this.argLevelConstraints.putAll(this.ranges[i].getArgLevelConstraints());
    }
    for (int i=0; i < this.operands.length; i++) {
      ExprOrOpArgNode opdi=this.operands[i];
      if (opdi != null && opdi instanceof OpArgNode && ((OpArgNode)opdi).getOp().isParam()) {
        SymbolNode opArg=((OpArgNode)opdi).getOp();
        int alen=opArg.getArity();
        for (int j=0; j < alen; j++) {
          ParamAndPosition pap=new ParamAndPosition(opArg,j);
          Integer mlevel=new Integer(opDef.getMinMaxLevel(i,j));
          this.argLevelConstraints.put(pap,mlevel);
        }
        for (int j=0; j < this.operands.length; j++) {
          for (int k=0; k < alen; k++) {
            if (opDef.getOpLevelCond(i,j,k)) {
              ParamAndPosition pap=new ParamAndPosition(opArg,k);
              Integer mlevel=new Integer(this.operands[j].getLevel());
              this.argLevelConstraints.put(pap,mlevel);
            }
          }
        }
      }
    }
    iter=alpSet.iterator();
    while (iter.hasNext()) {
      ArgLevelParam alp=(ArgLevelParam)iter.next();
      ExprOrOpArgNode arg=this.getArg(alp.op);
      if (arg != null) {
        arg.levelCheck(itr);
        ParamAndPosition pap=new ParamAndPosition(alp.op,alp.i);
        this.argLevelConstraints.put(pap,new Integer(arg.getLevel()));
      }
    }
    this.argLevelParams=new HashSet();
    for (int i=0; i < this.operands.length; i++) {
      if (this.operands[i] != null) {
        if (allBoundSymbols.size() == 0) {
          this.argLevelParams.addAll(this.operands[i].getArgLevelParams());
        }
 else {
          Iterator alpiter=this.operands[i].getArgLevelParams().iterator();
          while (alpiter.hasNext()) {
            ArgLevelParam alp=(ArgLevelParam)alpiter.next();
            if (!allBoundSymbols.contains(alp.param)) {
              this.argLevelParams.add(alp);
            }
          }
          ;
        }
      }
    }
    ;
    for (int i=0; i < this.ranges.length; i++) {
      this.argLevelParams.addAll(this.ranges[i].getArgLevelParams());
    }
    ;
    iter=alpSet.iterator();
    while (iter.hasNext()) {
      ArgLevelParam alp=(ArgLevelParam)iter.next();
      ExprOrOpArgNode arg=this.getArg(alp.op);
      if (arg == null) {
        arg=this.getArg(alp.param);
        if (arg == null) {
          this.argLevelParams.add(alp);
        }
 else {
          arg.levelCheck(itr);
          Iterator iter1=arg.getLevelParams().iterator();
          while (iter1.hasNext()) {
            SymbolNode param=(SymbolNode)iter1.next();
            this.argLevelParams.add(new ArgLevelParam(alp.op,alp.i,param));
          }
        }
      }
 else {
        if (arg instanceof OpArgNode && ((OpArgNode)arg).getOp().isParam()) {
          SymbolNode argOp=((OpArgNode)arg).getOp();
          this.argLevelParams.add(new ArgLevelParam(argOp,alp.i,alp.param));
        }
      }
    }
    for (int i=0; i < this.operands.length; i++) {
      ExprOrOpArgNode opdi=this.operands[i];
      if (opdi != null && opdi instanceof OpArgNode && ((OpArgNode)opdi).getOp().isParam()) {
        SymbolNode opArg=((OpArgNode)opdi).getOp();
        int alen=opArg.getArity();
        for (int j=0; j < this.operands.length; j++) {
          for (int k=0; k < alen; k++) {
            if (opDef.getOpLevelCond(i,j,k)) {
              Iterator iter1=this.operands[j].getLevelParams().iterator();
              while (iter1.hasNext()) {
                SymbolNode param=(SymbolNode)iter1.next();
                this.argLevelParams.add(new ArgLevelParam(opArg,k,param));
              }
            }
          }
        }
      }
    }
  }
 else {
    this.operator.levelCheck(itr);
    this.level=this.operator.getLevel();
    for (int i=0; i < this.operands.length; i++) {
      this.operands[i].levelCheck(itr);
      this.level=Math.max(this.level,this.operands[i].getLevel());
    }
    this.levelParams=new HashSet();
    this.levelParams.add(this.operator);
    this.allParams.add(this.operator);
    for (int i=0; i < this.operands.length; i++) {
      this.levelParams.addAll(this.operands[i].getLevelParams());
      this.allParams.addAll(this.operands[i].getAllParams());
      this.nonLeibnizParams.addAll(this.operands[i].getNonLeibnizParams());
    }
    this.levelConstraints=new SetOfLevelConstraints();
    for (int i=0; i < this.operands.length; i++) {
      this.levelConstraints.putAll(this.operands[i].getLevelConstraints());
    }
    this.argLevelConstraints=new SetOfArgLevelConstraints();
    for (int i=0; i < this.operands.length; i++) {
      this.argLevelConstraints.put(this.operator,i,this.operands[i].getLevel());
      this.argLevelConstraints.putAll(this.operands[i].getArgLevelConstraints());
    }
    this.argLevelParams=new HashSet();
    for (int i=0; i < this.operands.length; i++) {
      HashSet lpSet=this.operands[i].getLevelParams();
      Iterator iter=lpSet.iterator();
      while (iter.hasNext()) {
        SymbolNode param=(SymbolNode)iter.next();
        this.argLevelParams.add(new ArgLevelParam(this.operator,i,param));
      }
      ;
      this.argLevelParams.addAll(this.operands[i].getArgLevelParams());
    }
    ;
  }
  ;
  String opName=this.operator.getName().toString();
  if (opName.equals("String_Node_Str")) {
    ExprNode arg=(ExprNode)this.getArgs()[0];
    if ((arg.getLevel() == ActionLevel) && (arg.getKind() == OpApplKind)) {
      if (!((OpApplNode)arg).operator.getName().toString().equals("String_Node_Str")) {
        errors.addError(stn.getLocation(),"String_Node_Str");
      }
    }
  }
  ;
  if (opName.equals("String_Node_Str")) {
    ExprNode arg=(ExprNode)this.getArgs()[0];
    if ((arg.getLevel() == ActionLevel) && (arg.getKind() == OpApplKind)) {
      if (!((OpApplNode)arg).operator.getName().toString().equals("String_Node_Str")) {
        errors.addError(stn.getLocation(),"String_Node_Str");
      }
    }
  }
  ;
  if (opName.equals("String_Node_Str") || opName.equals("String_Node_Str")) {
    if ((this.getArgs()[0].getLevel() == ActionLevel) || (this.getArgs()[1].getLevel() == ActionLevel)) {
      errors.addError(stn.getLocation(),"String_Node_Str" + "String_Node_Str");
    }
  }
  ;
  if ((this.level == TemporalLevel) && (opName.equals("String_Node_Str") || opName.equals("String_Node_Str"))) {
    for (int i=0; i < this.ranges.length; i++) {
      if (this.ranges[i].getLevel() == ActionLevel) {
        errors.addError(this.ranges[i].stn.getLocation(),"String_Node_Str");
      }
    }
  }
  return this.levelCorrect;
}

Fixed version (ground truth):
/** 
 * The following was used for debugging.  It might be useful again, so I'm   keeping it here in as a comment.                                         
 */
public final boolean levelCheck(int itr){
  if (this.levelChecked >= itr)   return this.levelCorrect;
  this.levelChecked=itr;
  this.levelCorrect=true;
  for (int i=0; i < this.operands.length; i++) {
    if (this.operands[i] != null && !this.operands[i].levelCheck(itr)) {
      this.levelCorrect=false;
    }
  }
  for (int i=0; i < this.ranges.length; i++) {
    if (this.ranges[i] != null && !this.ranges[i].levelCheck(itr)) {
      this.levelCorrect=false;
    }
  }
  if (this.operator instanceof AnyDefNode) {
    AnyDefNode opDef=(AnyDefNode)this.operator;
    boolean opDefLevelCheck=opDef.levelCheck(itr);
    for (int i=0; i < this.operands.length; i++) {
      ExprOrOpArgNode opd=this.operands[i];
      if (opd != null) {
        if (opd.getLevel() > opDef.getMaxLevel(i)) {
          if (opDefLevelCheck && opd.levelCheck(itr)) {
            errors.addError(this.stn.getLocation(),"String_Node_Str" + opDef.getName() + "String_Node_Str"+ (i + 1)+ "String_Node_Str"+ "String_Node_Str");
          }
          this.levelCorrect=false;
        }
        if (opd instanceof OpArgNode && ((OpArgNode)opd).getOp() instanceof AnyDefNode) {
          AnyDefNode opdDef=(AnyDefNode)((OpArgNode)opd).getOp();
          boolean opdDefLevelCheck=opdDef.levelCheck(itr);
          int alen=opdDef.getArity();
          for (int j=0; j < alen; j++) {
            if (opdDef.getMaxLevel(j) < opDef.getMinMaxLevel(i,j)) {
              if (opDefLevelCheck && opd.levelCheck(itr)) {
                errors.addError(this.stn.getLocation(),"String_Node_Str" + opDef.getName() + "String_Node_Str"+ "String_Node_Str"+ (j + 1)+ "String_Node_Str"+ (i + 1)+ "String_Node_Str"+ opDef.getMinMaxLevel(i,j)+ "String_Node_Str");
              }
              this.levelCorrect=false;
            }
          }
          for (int j=0; j < this.operands.length; j++) {
            for (int k=0; k < alen; k++) {
              if (opDef.getOpLevelCond(i,j,k) && this.operands[j].getLevel() > opdDef.getMaxLevel(k)) {
                if (opd.levelCheck(itr) && this.operands[j].levelCheck(itr)) {
                  errors.addError(this.stn.getLocation(),"String_Node_Str" + opDef.getName() + "String_Node_Str"+ (j + 1)+ "String_Node_Str"+ "String_Node_Str");
                }
                this.levelCorrect=false;
              }
            }
          }
        }
      }
    }
    for (int i=0; i < this.ranges.length; i++) {
      ExprNode range=this.ranges[i];
      if (range != null) {
        boolean rangeLevelCheck=range.levelCheck(itr);
        if (range.getLevel() > ActionLevel) {
          if (rangeLevelCheck) {
            errors.addError(this.stn.getLocation(),"String_Node_Str" + opDef.getName() + "String_Node_Str"+ boundedBoundSymbols[i][0]+ "String_Node_Str"+ "String_Node_Str");
          }
          this.levelCorrect=false;
        }
      }
    }
    this.level=opDef.getLevel();
    for (int i=0; i < this.operands.length; i++) {
      if (this.operands[i] != null && opDef.getWeight(i) == 1) {
        this.level=Math.max(this.level,this.operands[i].getLevel());
      }
    }
    for (int i=0; i < this.ranges.length; i++) {
      this.level=Math.max(this.level,this.ranges[i].getLevel());
    }
    this.levelParams.addAll(opDef.getLevelParams());
    this.allParams.addAll(opDef.getAllParams());
    this.nonLeibnizParams.addAll(opDef.getNonLeibnizParams());
    int ar=opDef.getArity();
    for (int i=0; i < this.operands.length; i++) {
      if (this.operands[i] != null && opDef.getWeight(i) == 1) {
        this.levelParams.addAll(this.operands[i].getLevelParams());
      }
      ;
      if (this.operands[i] != null) {
        this.allParams.addAll(this.operands[i].getAllParams());
        this.nonLeibnizParams.addAll(this.operands[i].getNonLeibnizParams());
      }
      ;
      int ii=i;
      if (ar == -1) {
        ii=0;
      }
      ;
      if (!opDef.getIsLeibnizArg()[ii]) {
        this.nonLeibnizParams.addAll(this.operands[i].getAllParams());
      }
    }
    for (int i=0; i < this.ranges.length; i++) {
      this.levelParams.addAll(this.ranges[i].getLevelParams());
      this.allParams.addAll(this.ranges[i].getAllParams());
      this.nonLeibnizParams.addAll(this.ranges[i].getNonLeibnizParams());
    }
    HashSet allBoundSymbols=new HashSet();
    if (this.unboundedBoundSymbols != null) {
      for (int i=0; i < this.unboundedBoundSymbols.length; i++) {
        allBoundSymbols.add(this.unboundedBoundSymbols[i]);
      }
    }
    ;
    if (this.boundedBoundSymbols != null) {
      for (int i=0; i < this.boundedBoundSymbols.length; i++) {
        if (this.boundedBoundSymbols[i] != null) {
          for (int j=0; j < this.boundedBoundSymbols[i].length; j++) {
            allBoundSymbols.add(this.boundedBoundSymbols[i][j]);
          }
        }
      }
    }
    ;
    Iterator absIter=allBoundSymbols.iterator();
    while (absIter.hasNext()) {
      Object nextBoundSymbol=absIter.next();
      this.levelParams.remove(nextBoundSymbol);
      this.allParams.remove(nextBoundSymbol);
      this.nonLeibnizParams.remove(nextBoundSymbol);
    }
    ;
    this.levelConstraints.putAll(opDef.getLevelConstraints());
    for (int i=0; i < this.operands.length; i++) {
      if (this.operands[i] != null) {
        if (allBoundSymbols.size() == 0) {
          this.levelConstraints.putAll(this.operands[i].getLevelConstraints());
        }
 else {
          SetOfLevelConstraints lcons=this.operands[i].getLevelConstraints();
          Iterator iter=lcons.keySet().iterator();
          while (iter.hasNext()) {
            SymbolNode param=(SymbolNode)iter.next();
            if (!allBoundSymbols.contains(param)) {
              this.levelConstraints.put(param,lcons.get(param));
            }
          }
        }
      }
    }
    for (int i=0; i < this.ranges.length; i++) {
      this.levelConstraints.putAll(this.ranges[i].getLevelConstraints());
    }
    for (int i=0; i < this.operands.length; i++) {
      Integer mlevel=new Integer(opDef.getMaxLevel(i));
      if (this.operands[i] != null) {
        Iterator iter=this.operands[i].getLevelParams().iterator();
        while (iter.hasNext()) {
          this.levelConstraints.put(iter.next(),mlevel);
        }
      }
    }
    for (int i=0; i < this.operands.length; i++) {
      ExprOrOpArgNode opdi=this.operands[i];
      if (opdi != null && opdi instanceof OpArgNode && ((OpArgNode)opdi).getOp() instanceof AnyDefNode) {
        AnyDefNode argDef=(AnyDefNode)((OpArgNode)opdi).getOp();
        argDef.levelCheck(itr);
        int alen=argDef.getArity();
        for (int j=0; j < this.operands.length; j++) {
          for (int k=0; k < alen; k++) {
            if (opDef.getOpLevelCond(i,j,k)) {
              Integer mlevel=new Integer(argDef.getMaxLevel(k));
              Iterator iter=this.operands[j].getLevelParams().iterator();
              while (iter.hasNext()) {
                this.levelConstraints.put(iter.next(),mlevel);
              }
            }
          }
        }
        ;
        if (!argDef.getIsLeibniz()) {
          for (int j=0; j < this.operands.length; j++) {
            for (int k=0; k < alen; k++) {
              if (opDef.getOpLevelCond(i,j,k) && !argDef.getIsLeibnizArg()[k]) {
                this.nonLeibnizParams.addAll(this.operands[j].getAllParams());
              }
            }
          }
          ;
        }
        ;
      }
    }
    HashSet alpSet=opDef.getArgLevelParams();
    Iterator iter=alpSet.iterator();
    while (iter.hasNext()) {
      ArgLevelParam alp=(ArgLevelParam)iter.next();
      ExprOrOpArgNode arg=this.getArg(alp.op);
      if (arg != null && arg instanceof OpArgNode && ((OpArgNode)arg).getOp() instanceof AnyDefNode) {
        AnyDefNode argDef=(AnyDefNode)((OpArgNode)arg).getOp();
        argDef.levelCheck(itr);
        Integer mlevel=new Integer(argDef.getMaxLevel(alp.i));
        this.levelConstraints.put(alp.param,mlevel);
      }
    }
    this.argLevelConstraints.putAll(opDef.getArgLevelConstraints());
    for (int i=0; i < this.operands.length; i++) {
      if (this.operands[i] != null) {
        this.argLevelConstraints.putAll(this.operands[i].getArgLevelConstraints());
      }
    }
    for (int i=0; i < this.ranges.length; i++) {
      this.argLevelConstraints.putAll(this.ranges[i].getArgLevelConstraints());
    }
    for (int i=0; i < this.operands.length; i++) {
      ExprOrOpArgNode opdi=this.operands[i];
      if (opdi != null && opdi instanceof OpArgNode && ((OpArgNode)opdi).getOp().isParam()) {
        SymbolNode opArg=((OpArgNode)opdi).getOp();
        int alen=opArg.getArity();
        for (int j=0; j < alen; j++) {
          ParamAndPosition pap=new ParamAndPosition(opArg,j);
          Integer mlevel=new Integer(opDef.getMinMaxLevel(i,j));
          this.argLevelConstraints.put(pap,mlevel);
        }
        for (int j=0; j < this.operands.length; j++) {
          for (int k=0; k < alen; k++) {
            if (opDef.getOpLevelCond(i,j,k)) {
              ParamAndPosition pap=new ParamAndPosition(opArg,k);
              Integer mlevel=new Integer(this.operands[j].getLevel());
              this.argLevelConstraints.put(pap,mlevel);
            }
          }
        }
      }
    }
    iter=alpSet.iterator();
    while (iter.hasNext()) {
      ArgLevelParam alp=(ArgLevelParam)iter.next();
      ExprOrOpArgNode arg=this.getArg(alp.op);
      if (arg != null) {
        arg.levelCheck(itr);
        ParamAndPosition pap=new ParamAndPosition(alp.op,alp.i);
        this.argLevelConstraints.put(pap,new Integer(arg.getLevel()));
      }
    }
    this.argLevelParams=new HashSet();
    for (int i=0; i < this.operands.length; i++) {
      if (this.operands[i] != null) {
        if (allBoundSymbols.size() == 0) {
          this.argLevelParams.addAll(this.operands[i].getArgLevelParams());
        }
 else {
          Iterator alpiter=this.operands[i].getArgLevelParams().iterator();
          while (alpiter.hasNext()) {
            ArgLevelParam alp=(ArgLevelParam)alpiter.next();
            if (!allBoundSymbols.contains(alp.param)) {
              this.argLevelParams.add(alp);
            }
          }
          ;
        }
      }
    }
    ;
    for (int i=0; i < this.ranges.length; i++) {
      this.argLevelParams.addAll(this.ranges[i].getArgLevelParams());
    }
    ;
    iter=alpSet.iterator();
    while (iter.hasNext()) {
      ArgLevelParam alp=(ArgLevelParam)iter.next();
      ExprOrOpArgNode arg=this.getArg(alp.op);
      if (arg == null) {
        arg=this.getArg(alp.param);
        if (arg == null) {
          this.argLevelParams.add(alp);
        }
 else {
          arg.levelCheck(itr);
          Iterator iter1=arg.getLevelParams().iterator();
          while (iter1.hasNext()) {
            SymbolNode param=(SymbolNode)iter1.next();
            this.argLevelParams.add(new ArgLevelParam(alp.op,alp.i,param));
          }
        }
      }
 else {
        if (arg instanceof OpArgNode && ((OpArgNode)arg).getOp().isParam()) {
          SymbolNode argOp=((OpArgNode)arg).getOp();
          this.argLevelParams.add(new ArgLevelParam(argOp,alp.i,alp.param));
        }
      }
    }
    for (int i=0; i < this.operands.length; i++) {
      ExprOrOpArgNode opdi=this.operands[i];
      if (opdi != null && opdi instanceof OpArgNode && ((OpArgNode)opdi).getOp().isParam()) {
        SymbolNode opArg=((OpArgNode)opdi).getOp();
        int alen=opArg.getArity();
        for (int j=0; j < this.operands.length; j++) {
          for (int k=0; k < alen; k++) {
            if (opDef.getOpLevelCond(i,j,k)) {
              Iterator iter1=this.operands[j].getLevelParams().iterator();
              while (iter1.hasNext()) {
                SymbolNode param=(SymbolNode)iter1.next();
                this.argLevelParams.add(new ArgLevelParam(opArg,k,param));
              }
            }
          }
        }
      }
    }
  }
 else {
    this.operator.levelCheck(itr);
    this.level=this.operator.getLevel();
    for (int i=0; i < this.operands.length; i++) {
      this.operands[i].levelCheck(itr);
      this.level=Math.max(this.level,this.operands[i].getLevel());
    }
    this.levelParams=new HashSet();
    this.levelParams.add(this.operator);
    this.allParams.add(this.operator);
    for (int i=0; i < this.operands.length; i++) {
      this.levelParams.addAll(this.operands[i].getLevelParams());
      this.allParams.addAll(this.operands[i].getAllParams());
      this.nonLeibnizParams.addAll(this.operands[i].getNonLeibnizParams());
    }
    this.levelConstraints=new SetOfLevelConstraints();
    for (int i=0; i < this.operands.length; i++) {
      this.levelConstraints.putAll(this.operands[i].getLevelConstraints());
    }
    this.argLevelConstraints=new SetOfArgLevelConstraints();
    for (int i=0; i < this.operands.length; i++) {
      this.argLevelConstraints.put(this.operator,i,this.operands[i].getLevel());
      this.argLevelConstraints.putAll(this.operands[i].getArgLevelConstraints());
    }
    this.argLevelParams=new HashSet();
    for (int i=0; i < this.operands.length; i++) {
      HashSet lpSet=this.operands[i].getLevelParams();
      Iterator iter=lpSet.iterator();
      while (iter.hasNext()) {
        SymbolNode param=(SymbolNode)iter.next();
        this.argLevelParams.add(new ArgLevelParam(this.operator,i,param));
      }
      ;
      this.argLevelParams.addAll(this.operands[i].getArgLevelParams());
    }
    ;
  }
  ;
  String opName=this.operator.getName().toString();
  if (opName.equals("String_Node_Str")) {
    ExprNode arg=(ExprNode)this.getArgs()[0];
    if ((arg.getLevel() == ActionLevel) && (arg.getKind() == OpApplKind)) {
      if (!((OpApplNode)arg).operator.getName().toString().equals("String_Node_Str")) {
        errors.addError(stn.getLocation(),"String_Node_Str");
      }
    }
  }
  ;
  if (opName.equals("String_Node_Str")) {
    ExprNode arg=(ExprNode)this.getArgs()[0];
    if ((arg.getLevel() == ActionLevel) && (arg.getKind() == OpApplKind)) {
      if (!((OpApplNode)arg).operator.getName().toString().equals("String_Node_Str")) {
        errors.addError(stn.getLocation(),"String_Node_Str");
      }
    }
  }
  ;
  if (opName.equals("String_Node_Str") || opName.equals("String_Node_Str")) {
    if ((this.getArgs()[0].getLevel() == ActionLevel) || (this.getArgs()[1].getLevel() == ActionLevel)) {
      errors.addError(stn.getLocation(),"String_Node_Str" + "String_Node_Str");
    }
  }
  ;
  if ((this.level == TemporalLevel) && (opName.equals("String_Node_Str") || opName.equals("String_Node_Str"))) {
    for (int i=0; i < this.ranges.length; i++) {
      if (this.ranges[i].getLevel() == ActionLevel) {
        errors.addError(this.ranges[i].stn.getLocation(),"String_Node_Str");
      }
    }
  }
  return this.levelCorrect;
}