comfac.red 891 B

1234567891011121314151617181920212223242526272829303132333435
  1. module comfac; % Multivariate common factor/content routines.
  2. % Author: Anthony C. Hearn.
  3. % Copyright (c) 1989 The RAND Corporation. All Rights Reserved.
  4. symbolic smacro procedure domain!-gcd(u,v); gcdn(u,v);
  5. symbolic smacro procedure domain!-onep u; onep u;
  6. symbolic procedure mv!-pow!-zerop u;
  7. null u or zerop car u and mv!-pow!-zerop cdr u;
  8. symbolic procedure mv!-pow!-gcd(u,v);
  9. if null u then nil
  10. else min(car u,car v) . mv!-pow!-gcd(cdr u,cdr v);
  11. symbolic procedure mv!-content u;
  12. % Finds the term that is the content of u.
  13. if null u then nil
  14. else begin scalar x,y;
  15. x := mv!-lc u;
  16. y := mv!-lpow u;
  17. a: u := mv!-red u;
  18. if null u or domain!-onep x and mv!-pow!-zerop y
  19. then return mv!-!.!*(y,x);
  20. x := domain!-gcd(x,mv!-lc u);
  21. y := mv!-pow!-gcd(y,mv!-lpow u);
  22. go to a
  23. end;
  24. endmodule;
  25. end;