groebmes.red 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. module groebmes;
  2. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  3. %
  4. % trace messages for the algorithms
  5. %
  6. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  7. fluid '(vdpvars!* !*trgroeb !*trgroebs !*trgroeb1 !*trgroebr hcount!*
  8. hzerocount!* factorlevel!* basecount!* groetime!* pcount!*);
  9. symbolic procedure groebpairprint (p);
  10. <<groebmessff(" pair(",cadr p,nil);
  11. groebmessff(",",caddr p,nil);
  12. prin2 "), ";
  13. prin2 " lcm = ";print car p>>;
  14. symbolic procedure groetimeprint;
  15. << prin2 ">> accum. cpu time:";
  16. prin2 (time() - groetime!*);
  17. prin2t " ms">>;
  18. symbolic procedure groebmessff (m1,f,m2);
  19. << prin2 m1; prin2 vdpnumber f;
  20. if !*gsugar then <<prin2 "/";prin2 gsugar f>>;
  21. if m2 then prin2t m2 >>;
  22. symbolic procedure groebmess0 (p);
  23. if !*trgroeb then vdpprint p;
  24. symbolic procedure groebmess1 (g,d);
  25. if !*trgroeb then <<
  26. g := g; d := d;
  27. prin2 " variables: "; print vdpvars!*;
  28. printbl();
  29. prin2t " Start of ITERATION "; terpri (); >>;
  30. symbolic procedure groebmess2 f;
  31. if !*trgroeb then << terpri();
  32. groebmessff ("polynomial ",f," eliminated");
  33. groetimeprint()>>;
  34. symbolic procedure groebmess2a(f,cf,fn);
  35. if !*trgroeb then << terpri();
  36. groebmessff ("polynomial ",f,nil);
  37. groebmessff (" elim. with cofactor ",cf," to");
  38. vdpprint fn; terpri(); groetimeprint()>>;
  39. symbolic procedure groebmess3(p,s);
  40. if !*trgroebs then <<
  41. prin2 "S-polynomial from ";
  42. groebpairprint p;
  43. vdpprint s; terpri();
  44. groetimeprint(); terprit 3 >>;
  45. symbolic procedure groebmess4 (p,d);
  46. << hcount!* := hcount!*+1;
  47. hzerocount!* := hzerocount!*+1;
  48. if !*trgroeb then << terpri(); printbl();
  49. groebmessff(" reduction (",cadr p,nil);
  50. groebmessff(",", caddr p,nil);
  51. prin2 ") leads to 0; ";
  52. << prin2 n;
  53. prin2 if n=1 then " pair" else " pairs">>
  54. where n=length d;
  55. prin2t " left";
  56. printbl(); groetimeprint()>>; >>;
  57. symbolic procedure groebmess41 (p);
  58. << hcount!* := hcount!*+1;
  59. hzerocount!* := hzerocount!*+1;
  60. if !*trgroeb then << terpri(); printbl();
  61. groebmessff(" polynomial(", p,nil);
  62. prin2 ") reduced to 0;";
  63. terpri(); printbl(); groetimeprint()>> >>;
  64. symbolic procedure groebmess5(p,h);
  65. if car p then
  66. << hcount!* := hcount!* + 1;
  67. if !*trgroeb then << terpri(); prin2 "H-polynomial ";
  68. prin2 pcount!*;
  69. prin2 " ev:"; prin2 vdpevlmon h;
  70. groebmessff(" from pair (",cadr p,nil);
  71. groebmessff(",", caddr p,")");
  72. vdpprint h; terpri(); groetimeprint() >> >>
  73. else
  74. if !*trgroeb then << prin2t "from actual problem input:";
  75. vdpprint h; groetimeprint() >>;
  76. symbolic procedure groebmess50(g);
  77. if !*trgroeb1 then << prin2 "list of active polynomials:";
  78. for each d1 in g do
  79. <<prin2 vdpgetprop(d1,'number);
  80. prin2 " ">>; terprit 2 >>;
  81. symbolic procedure groebmess51(d);
  82. if !*trgroeb1 then <<
  83. prin2t "Candidates for pairs in this step:";
  84. for each d1 in d do groebpairprint (d1);
  85. terprit 2 >>;
  86. symbolic procedure groebmess52(d);
  87. if !*trgroeb1 then <<
  88. prin2t "Actual new pairs from this step:";
  89. for each d1 in d do groebpairprint (d1);
  90. terprit 2 >>;
  91. symbolic procedure groebmess7 h;
  92. if !*trgroebs then
  93. <<prin2t "Testing factorization for "; vdpprint h>>;
  94. symbolic procedure groebmess8 (g,d);
  95. if !*trgroeb1 then <<
  96. g := g; prin2t " actual pairs: ";
  97. if null d then prin2t "null"
  98. else for each d1 in d do groebpairprint d1;
  99. groetimeprint() >>
  100. else if !*trgroeb then <<
  101. prin2 n; prin2t if n=1 then " pair" else " pairs" >>
  102. where n=length d;
  103. symbolic procedure groebmess13(g,problems);
  104. if !*trgroeb or !*trgroebr then <<
  105. if g then << basecount!* := basecount!* +1;
  106. printbl(); printbl();
  107. prin2 "end of iteration ";
  108. for each f in reverse factorlevel!* do
  109. <<prin2 f; prin2 ".">>;
  110. prin2 "; basis "; prin2 basecount!*; prin2t ":";
  111. prin2 "{"; for each g1 in g do vdpprin3t g1; prin2t "}";
  112. printbl(); printbl(); groetimeprint() >>
  113. else
  114. << printbl(); prin2 "end of iteration branch ";
  115. for each f in reverse factorlevel!* do
  116. <<prin2 f; prin2 ".">>;
  117. prin2t " "; printbl(); groetimeprint()>>;
  118. if problems and !*trgroeb then
  119. << groetimeprint(); terpri(); printbl();
  120. prin2 " number of partial problems still to be solved:";
  121. prin2t length problems; terpri();
  122. prin2 " preparing next problem ";
  123. if car car problems = 'file then prin2 cdr car problems
  124. else if cadddr car problems then
  125. vdpprint car cadddr car problems; terpri(); >> >>;
  126. symbolic procedure groebmess14 (h,hf);
  127. if !*trgroeb then <<
  128. prin2 "******************* factorization of polynomial ";
  129. (if x then prin2t x else terpri() )
  130. where x = vdpnumber(h);
  131. prin2t " factors:";
  132. for each g in hf do vdpprint car g; groetimeprint()>>;
  133. symbolic procedure groebmess15 f;
  134. if !*trgroeb then
  135. <<prin2t "***** monomial factor reduced:";
  136. vdpprint vdpfmon(a2vbc 1,f)>>;
  137. symbolic procedure groebmess19(p,restr,u);
  138. if !*trgroeb then <<
  139. u := u; restr := restr; printbl();
  140. prin2 "calculation branch ";
  141. for each f in reverse factorlevel!* do
  142. <<prin2 f; prin2 ".">>;
  143. prin2t " cancelled because"; vdpprint p;
  144. prin2t "is member of an actual abort condition";
  145. printbl(); printbl()>>;
  146. symbolic procedure groebmess19a(p,u);
  147. if !*trgroeb then << u := u; printbl();
  148. prin2 "during branch preparation ";
  149. for each f in reverse u do <<prin2 f; prin2 ".">>;
  150. prin2t " cancelled because"; vdpprint p;
  151. prin2t "was found in the ideal branch"; printbl()>>;
  152. symbolic procedure groebmess20 (p);
  153. if !*trgroeb then <<
  154. terpri(); prin2 "secondary reduction starting with";
  155. vdpprint p>>;
  156. symbolic procedure groebmess21(p1,p2);
  157. if !*trgroeb then <<
  158. prin2 "polynomial "; prin2 vdpnumber p1;
  159. prin2 " replaced during secondary reduction by ";
  160. vdpprint p2>>;
  161. symbolic procedure groebmess22(factl,abort1,abort2);
  162. if null factl then nil
  163. else
  164. if !*trgroeb then
  165. begin integer n;
  166. prin2t "BRANCHING after factorization point";
  167. n := 0; for each x in reverse factl do
  168. << n := n+1; prin2 "branch ";
  169. for each f in reverse factorlevel!* do
  170. <<prin2 f;prin2 ".">>;
  171. prin2t n; for each y in car x do vdpprint y;
  172. prin2t "simple IGNORE restrictions for this branch:";
  173. for each y in abort1 do vdpprint y;
  174. for each y in cadr x do vdpprint y;
  175. if abort2 or caddr x then
  176. <<prin2t
  177. "set type IGNORE restrictions for this branch:";
  178. for each y in abort2 do vdpprintset y;
  179. for each y in caddr x do vdpprintset y >>;
  180. printbl()>>;
  181. end;
  182. symbolic procedure groebmess23 (g0,rest1,rest2);
  183. if !*trgroeb then
  184. if null factorlevel!* then
  185. prin2t "** starting calculation ******************************"
  186. else << prin2 "** resuming calculation for branch ";
  187. for each f in reverse factorlevel!* do
  188. <<prin2 f; prin2 ".">>;
  189. terpri(); if rest1 or rest2 then
  190. <<
  191. prin2t "-------IGNORE restrictions for this branch:";
  192. g0 := g0; for each x in rest1 do vdpprint x;
  193. for each x in rest2 do vdpprintset x>> >>;
  194. symbolic procedure groebmess24(h,problems1,restr);
  195. % if !*trgroeb then
  196. <<prin2t "**********polynomial affected by branch restriction:";
  197. vdpprint h; if restr then prin2t "under current restrictions";
  198. for each x in restr do vdpprint x;
  199. if null problems1 then prin2t " CANCELLED"
  200. else <<prin2t "partitioned into";
  201. vdpprintset car problems1>> >>;
  202. symbolic procedure groebmess25 (h,abort2);
  203. <<prin2t "reduction of set type cancel conditions by";
  204. vdpprint h; prin2t "remaining:";
  205. for each x in abort2 do vdpprintset x>>;
  206. symbolic procedure groebmess26 (f1,f2);
  207. if !*trgroebs and not vdpequal(f1,f2) then
  208. <<terpri(); prin2t "during final reduction";
  209. vdpprint f1; prin2t "reduced to";
  210. vdpprint f2; terpri()>>;
  211. symbolic procedure groebmess27 r;
  212. if !*trgroeb then <<terpri();
  213. prin2t "factor ignored (considered already):"; vdpprint r>>;
  214. symbolic procedure groebmess27a (h,r);
  215. if !*trgroeb then
  216. <<terpri(); vdpprint h;
  217. prin2t " reduced to zero by factor"; vdpprint r>>;
  218. symbolic procedure groebmess28 r;
  219. if !*trgroeb then
  220. <<writepri("interim content reduction:", 'first);
  221. writepri(mkquote prepsq r, 'last)>>;
  222. symbolic procedure groebmess29 omega;
  223. if !*trgroeb then
  224. <<terpri(); prin2 "actual weight vector: [";
  225. for each x in omega do <<prin2 " "; prin2 x>>; prin2 "]";
  226. terpri(); terpri()>>;
  227. symbolic procedure groebmess30 gomegaplus;
  228. if !*trgroeb and gomegaplus then
  229. <<terpri(); prin2 "new head term (or full) basis "; terpri();
  230. for each x in gomegaplus do <<vdpprint x; terpri()>> >>;
  231. symbolic procedure groebmess31 gg;
  232. if !*trgroeb then <<prin2 "full basis"; terpri();
  233. for each x in gg do <<vdpprint x; terpri(); terpri() >> >>;
  234. symbolic procedure groebmess32 g;
  235. if !*trgroeb then <<terpri();
  236. prin2 "***** start of iteation with"; terpri();
  237. for each x in g do vdpprint x;
  238. prin2 "****************************";
  239. terpri()>>;
  240. symbolic procedure groebmess33 g;
  241. if !*trgroeb then
  242. <<terpri(); prin2 "***** resulting system *****"; terpri();
  243. for each x in g do vdpprint x;
  244. prin2 "****************************"; terpri()>>;
  245. symbolic procedure groebmess34 mx;
  246. if !*trgroeb then
  247. <<terpri(); prin2 "sum of weight vector "; print mx;
  248. terpri()>>;
  249. symbolic procedure groebmess35 omega;
  250. if !*trgroeb then
  251. <<terpri(); prin2 "next weight vector "; print omega;
  252. terpri()>>;
  253. symbolic procedure groebmess36 tt;
  254. if !*trgroeb then
  255. <<terpri(); prin2 "new weight: "; print tt>>;
  256. symbolic procedure groebmess37 s;
  257. if !*trgroeb then
  258. <<if not s then prin2 "NOT "; prin2 "taking initials";
  259. terpri(); terpri()>>;
  260. symbolic procedure printbl(); printb (linelength nil #- 2);
  261. symbolic procedure printb n; <<for i:=1:n do prin2 "-"; terpri()>>;
  262. symbolic procedure vdpprintset l;
  263. if l then << prin2 "{"; vdpprin2 car l;
  264. for each x in cdr l do <<prin2 "; "; vdpprin2 x>>;
  265. prin2t "}";>>;
  266. symbolic procedure vdpprin2l u;
  267. <<prin2 "("; vdpprin2 car u;
  268. for each x in cdr u do <<prin2 ","; vdpprin2 x;>>;
  269. prin2 ")";>>;
  270. endmodule;
  271. end;