algfn.red 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. MODULE ALGFN;
  2. % Author: James H. Davenport.
  3. % Check if an expression is in a pure algebraic extension of
  4. % Q(all "constants")(var).
  5. EXPORTS ALGFNPL,ALGEBRAICSF;
  6. IMPORTS SIMP,INTERR,DEPENDSP,DEPENDSPL;
  7. SYMBOLIC PROCEDURE ALGFNP(PF,VAR);
  8. IF ATOM PF THEN T
  9. ELSE IF NOT ATOM CAR PF THEN INTERR "Not prefix form"
  10. ELSE IF CAR PF EQ '!*SQ THEN ALGFNSQ(CADR PF,VAR)
  11. ELSE IF CAR PF EQ 'EXPT
  12. THEN IF NOT algint!-RATNUMP CADDR PF
  13. THEN (NOT DEPENDSP(CADR PF,VAR))
  14. AND (NOT DEPENDSP(CADDR PF,VAR))
  15. ELSE ALGFNP(CADR PF,VAR)
  16. ELSE IF NOT MEMQ(CAR PF,'(MINUS PLUS TIMES QUOTIENT SQRT))
  17. % JPff fiddle
  18. THEN NOT DEPENDSPL(CDR PF,VAR)
  19. ELSE ALGFNPL(CDR PF,VAR);
  20. SYMBOLIC PROCEDURE ALGFNPL(P!-LIST,VAR);
  21. NULL P!-LIST OR ALGFNP(CAR P!-LIST,VAR) AND ALGFNPL(CDR P!-LIST,VAR);
  22. SYMBOLIC PROCEDURE ALGFNSQ(SQ,VAR);
  23. ALGFNSF(NUMR SQ,VAR) AND ALGFNSF(DENR SQ,VAR);
  24. SYMBOLIC PROCEDURE ALGFNSF(SF,VAR);
  25. ATOM SF
  26. OR ALGFNP(MVAR SF,VAR) AND ALGFNSF(LC SF,VAR) AND ALGFNSF(RED SF,VAR);
  27. SYMBOLIC PROCEDURE algint!-RATNUMP Q;
  28. IF ATOM Q THEN NUMBERP Q
  29. ELSE CAR Q EQ 'QUOTIENT AND (NUMBERP CADR Q) AND (NUMBERP CADDR Q);
  30. SYMBOLIC PROCEDURE ALGEBRAICSF U;
  31. IF ATOM U THEN NIL
  32. ELSE ALGEBRAICP MVAR U OR ALGEBRAICSF LC U OR ALGEBRAICSF RED U;
  33. SYMBOLIC PROCEDURE ALGEBRAICP U;
  34. IF ATOM U THEN NIL
  35. ELSE IF CAR U EQ 'EXPT THEN 1 NEQ DENR SIMP CADDR U
  36. ELSE CAR U EQ 'SQRT;
  37. ENDMODULE;
  38. END;