示例#1
0
 /**
  * This function obtains from a predicate that is a conjunction of assignments the assignment
  * related to an identifier
  *
  * @param specID The identifier of a variable in the specification
  * @param pred A predicate
  * @return the equality
  */
 public static MemPred getRelatedEquality(Pred pred, String specID) {
   AbstractRepository<Pred> predRep = pred.accept(new AndPredClausesExtractor());
   AbstractIterator<Pred> predIt = predRep.createIterator();
   while (predIt.hasNext()) {
     Pred auxPred = predIt.next();
     if (auxPred instanceof MemPred) {
       MemPred memPred = ((MemPred) auxPred);
       if (memPred.getMixfix()) {
         String id = ((RefExpr) memPred.getLeftExpr()).getName().toString();
         if (id.equals(specID)) {
           return memPred;
         }
       } else return null;
     } else return null;
   }
   return null;
 }