algdcl.red 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. module algdcl; % Various declarations.
  2. % Author: Anthony C. Hearn.
  3. % Copyright (c) 1987 The RAND Corporation. All rights reserved.
  4. global '(preclis!* ws);
  5. symbolic procedure formopr(u,vars,mode);
  6. if mode eq 'symbolic
  7. then list('flag,mkquote cdr u,mkquote 'opfn)
  8. else list('operator,mkarg(cdr u,vars));
  9. put('operator,'formfn,'formopr);
  10. symbolic procedure operator u; for each j in u do mkop j;
  11. rlistat '(operator);
  12. symbolic procedure remopr u;
  13. % Remove all operator related properties from id u.
  14. begin
  15. remprop(u,'alt);
  16. remprop(u,'infix);
  17. remprop(u,'op);
  18. remprop(u,'prtch);
  19. remprop(u,'simpfn);
  20. remprop(u,'unary);
  21. remflag(list u,'linear);
  22. remflag(list u,'nary);
  23. remflag(list u,'opfn);
  24. remflag(list u,'antisymmetric);
  25. remflag(list u,'symmetric);
  26. remflag(list u,'right);
  27. preclis!* := delete(u,preclis!*)
  28. end;
  29. flag('(remopr),'eval);
  30. symbolic procedure den u;
  31. mk!*sq (denr simp!* u ./ 1);
  32. symbolic procedure num u;
  33. mk!*sq (numr simp!* u ./ 1);
  34. flag('(den num),'opfn);
  35. flag('(den num),'noval);
  36. put('saveas,'formfn,'formsaveas);
  37. symbolic procedure formsaveas(u,vars,mode);
  38. list('saveas,formclear1(cdr u,vars,mode));
  39. symbolic procedure saveas u;
  40. let00 list list(if smemq('!~,car u) then 'replaceby else 'equal,
  41. car u,
  42. if eqcar(ws,'!*sq)
  43. and smemql(for each x in frasc!* collect car x,
  44. cadr ws)
  45. then list('!*sq,cadr ws,nil)
  46. else ws);
  47. rlistat '(saveas);
  48. endmodule;
  49. end;