public static String createSqlFromProposition(Proposition proposition) {
    { NamedDescription relation = Logic.getDescription(((Surrogate)(proposition.operator)));
      RelationTableInfo tableinfo = RDBMS.getRelationTableInfo(relation);
      String tablealias = tableinfo.tableAlias;
      Vector arguments = proposition.arguments;
      OutputStringStream sql = OutputStringStream.newOutputStringStream();

      sql.nativeStream.print("SELECT DISTINCT ");
      RDBMS.printSqlColumnList(sql, tableinfo);
      sql.nativeStream.print(" FROM " + tableinfo.tableName);
      if (tablealias != null) {
        sql.nativeStream.print(" " + tablealias);
      }
      RDBMS.printSqlConstraintList(sql, tableinfo, arguments);
      return (sql.theStringReader());
    }
  }