public Assignment removePrimes(){
  Assignment a=new Assignment();
  for (  String var : map.keySet()) {
    if (!map.containsKey(var + "'")) {
      boolean hasPrime=(var.charAt(var.length() - 1) == '\'');
      String newVar=(hasPrime) ? var.substring(0,var.length() - 1) : var;
      a.addPair(newVar,map.get(var));
    }
  }
  return a;
}

public Assignment removePrimes ( ) { Assignment a = new Assignment ( ) ; for ( String var : map . keySet ( ) ) { if ( ! map . containsKey ( var + "'" ) ) { boolean hasPrime = ( var . charAt ( var . length ( ) - 1 ) == '\'' ) ; String newVar = ( hasPrime ) ? var . substring ( 0 , var . length ( ) - 1 ) : var ; a . addPair ( newVar , map . get ( var ) ) ; } } return a ; }
returns a new assignment with the primes removed .
