if av maxv then (*new optimumrecord it*opts :smaxv :av end the last assignment is based on the reasoning that the achievable value is the achieved valueonce all objects have been dealt with the condition exclusion is acceptable is expressed by av [ivalue maxv since it is used again thereafterthe value av [ivalue is given the name av in order to circumvent its reevaluation the entire procedure is now composed of the discussed parts with the addition of appropriate initialization statements for the global variables the ease of expressing inclusion and exclusion from the set by use of set operators is noteworthy the results opts and maxv of the program selection with weight allowances ranging from to are listed in table type object record valueweightinteger end(adens _optselection *var aarray of objectlimwtotvmaxvintegersoptssetprocedure try (itwavinteger)var tw av integerbegin if then (*try inclusion*tw :tw [iweightif tw <limw then : { }try( + tw av) : {iend(*try exclusion*av :av [ivalueif av maxv then try( + twav end elsif av maxv then maxv :avopts : end end tryprocedure selection (weightincweightlimitinteger)begin limw : repeat limw :limw weightincmaxv : :{}opts :{}try( totv)until limw >weightlimit end selection weightvalue limw maxv