dcfsfmisc.red 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. % ----------------------------------------------------------------------
  2. % $Id: dcfsfmisc.red,v 1.2 2004/04/26 16:24:12 dolzmann Exp $
  3. % ----------------------------------------------------------------------
  4. % Copyright (c) 2004 Thomas Sturm
  5. % ----------------------------------------------------------------------
  6. % $Log: dcfsfmisc.red,v $
  7. % Revision 1.2 2004/04/26 16:24:12 dolzmann
  8. % Procedure dcfsf_varlat now returns a list of variables in the sense of logic
  9. % and not a list of kernels containing these variables.
  10. %
  11. % Revision 1.1 2004/03/22 12:31:49 sturm
  12. % Initial check-in.
  13. % Mostly copied from acfsf.
  14. % Includes Diploma Thesis by Kacem plus wrapper for this.
  15. %
  16. % ----------------------------------------------------------------------
  17. lisp <<
  18. fluid '(dcfsf_misc_rcsid!* dcfsf_misc_copyright!*);
  19. dcfsf_misc_rcsid!* :=
  20. "$Id: dcfsfmisc.red,v 1.2 2004/04/26 16:24:12 dolzmann Exp $";
  21. dcfsf_misc_copyright!* := "Copyright (c) 2004 T. Sturm"
  22. >>;
  23. module dcfsfmisc;
  24. % Differentially closed field standard form miscellaneous. Submodule
  25. % of [dcfsf].
  26. procedure dcfsf_termprint(u);
  27. % Differentialally closed field term print. [u] is a
  28. % term. The return value is not specified. Prints [u] AM-like.
  29. <<
  30. sqprint !*f2q u where !*nat=nil;
  31. ioto_prin2 nil
  32. >>;
  33. procedure dcfsf_clnegrel(r,flg);
  34. % Differentialally closed field conditionally logically negate
  35. % relation. [r] is a relation. Returns for [flg] equal to [nil] a
  36. % relation $R$ such that for terms $t_1$, $t_2$ we have
  37. % $R(t_1,t_2)$ equivalent to $\lnot [r](t_1,t_2)$. Returns [r] for
  38. % non-[nil] [flg].
  39. if flg then r else dcfsf_lnegrel r;
  40. procedure dcfsf_lnegrel(r);
  41. % Differentialally closed field logically negate relation. [r] is a
  42. % relation. Returns a relation $R$ such that for terms $t_1$, $t_2$
  43. % we have $R(t_1,t_2)$ equivalent to $\lnot [r](t_1,t_2)$.
  44. if r eq 'equal then 'neq
  45. else if r eq 'neq then 'equal
  46. else rederr {"dcfsf_lnegrel: unknown operator ",r};
  47. procedure dcfsf_fctrat(atf);
  48. % Differentialally closed field factorize atomic formula. [atf] is an
  49. % atomic formula. Returns the factorized left hand side of [atf] as
  50. % a list $(...,(f_i . n_i),...)$, where the $f_i$ are the factors
  51. % as SF's and the $n_i$ are the corresponding multiplicities. The
  52. % integer content is dropped.
  53. cdr fctrf dcfsf_arg2l atf;
  54. procedure dcfsf_negateat(f);
  55. % Differentialally closed field negate atomic formula. [f] is an
  56. % atomic formula. Returns an atomic formula equivalent to $\lnot
  57. % [f]$.
  58. dcfsf_mkn(dcfsf_lnegrel dcfsf_op f,dcfsf_argn f);
  59. procedure dcfsf_varlat(atform);
  60. % Differentialally closed field variable list of atomic formula.
  61. % [atform] is an atomic formula. Returns the set of variables
  62. % contained in [atform] as a list.
  63. dcfsf_varlat1 kernels dcfsf_arg2l(atform);
  64. procedure dcfsf_varlat1(kl);
  65. foreach k in kl join
  66. if pairp k and car k eq 'd then
  67. {cadr k}
  68. else
  69. {k};
  70. procedure dcfsf_varsubstat(atf,new,old);
  71. % Differentialally closed substitute variable for variable in atomic
  72. % formula. [atf] is an atomic formula; [new] and [old] are
  73. % variables. Returns [atf] with [new] substituted for [old].
  74. dcfsf_0mk2(dcfsf_op atf,numr subf(dcfsf_arg2l atf,{old . new}));
  75. procedure dcfsf_ordatp(a1,a2);
  76. % Differentialally closed field order predicate for atomic formulas.
  77. % [a1] and [a2] are atomic formulas. Returns [T] iff [a1] is
  78. % strictly less than [a2] wrt. some syntactical ordering; returns
  79. % [nil] else. The specification that [nil] is returned if
  80. % $[a1]=[a2]$ is used in [dcfsf_subsumeandcut].
  81. begin scalar lhs1,lhs2;
  82. lhs1 := dcfsf_arg2l a1;
  83. lhs2 := dcfsf_arg2l a2;
  84. if lhs1 neq lhs2 then return ordp(lhs1,lhs2);
  85. return dcfsf_ordrelp(dcfsf_op a1,dcfsf_op a2)
  86. end;
  87. procedure dcfsf_ordrelp(r1,r2);
  88. % Differentialally closed field standard form relation order
  89. % predicate. [r1] and [r2] are dcfsf-relations. Returns a [T] iff
  90. % $[r1] <= [r2]$.
  91. r1 eq r2 or r1 eq 'equal;
  92. endmodule; % [dcfsfmisc]
  93. end; % of file