/**
  * Adds an expression and returns a reference name. If an alias is given, it specifies the alias
  * as an reference name.
  */
 public String addNamedExpr(NamedExpr namedExpr) throws PlanningException {
   if (namedExpr.hasAlias()) {
     return addExpr(namedExpr.getExpr(), namedExpr.getAlias());
   } else {
     return addExpr(namedExpr.getExpr());
   }
 }