@Override public String toString(){
  String str="";
  for (  String q : queryVars) {
    str+=q + ",";
  }
  if (!queryVars.isEmpty()) {
    str=str.substring(0,str.length() - 1);
  }
  if (!evidence.isEmpty()) {
    str+="|";
    if (!evidence.isEmpty()) {
      str+=evidence;
    }
  }
  str+="";
  if (this instanceof ProbQuery) {
    return "P(" + str + ")";
  }
 else   if (this instanceof UtilQuery) {
    return "U(" + str + ")";
  }
 else {
    return "Reduce(" + str + ")";
  }
}

@ Override public String toString ( ) { String str = "" ; for ( String q : queryVars ) { str += q + "," ; } if ( ! queryVars . isEmpty ( ) ) { str = str . substring ( 0 , str . length ( ) - 1 ) ; } if ( ! evidence . isEmpty ( ) ) { str += "|" ; if ( ! evidence . isEmpty ( ) ) { str += evidence ; } } str += "" ; if ( this instanceof ProbQuery ) { return "P(" + str + ")" ; } else if ( this instanceof UtilQuery ) { return "U(" + str + ")" ; } else { return "Reduce(" + str + ")" ; } }
returns a string representation of the query .
