condense.red 452 B

12345678910111213141516171819
  1. module condense; % unify exponent vectors for lower memory consumption.
  2. % Author: Herbert Melenk
  3. dipevlist!*:={nil};
  4. symbolic procedure dipcondense f;
  5. begin scalar dl,ev;
  6. dl:=dipevlist!*;
  7. while f do
  8. <<ev := dipevlmon f;
  9. while cdr dl and evcompless!?(dipevlmon f,cadr dl) do dl:=cdr dl;
  10. if cdr dl and ev=cadr dl
  11. then car f := cadr dl
  12. else cdr dl:= ev.cdr dl;
  13. f:=dipmred f >> end;
  14. endmodule;;end;