On 05/15/2008 11:27 AM, Martin Rubey wrote: > Thanks to Gaby, I was looking at the micro-semantics of the loop in the > following: > > lift?(p1:SUPP,p2:SUPP,uterm:UTerm,ldeg:List NNI, > lvar:List OV) : > Union(s:SUPP,failed:"failed",notCoprime:"notCoprime") == > leadpol:Boolean:=false > (listpol,lval):=(uterm.lpol,uterm.lint.first) > d:=listpol.first > listpol:=listpol.rest > nolift:Boolean:=true > for uf in listpol repeat > --note uf and d not necessarily primitive > degree gcd(uf,d) =0 => nolift:=false
Note, that "=>" does *not* break out of the loop. So if listpol has 1000 elements and the gcd of the first and second element is a constant, then still the loop is continued 998 times. I think that is a waste of time. > nolift => ["notCoprime"] > f:SUPP:=([p1,p2]$List(SUPP)).(position(uf,listpol)) By which specification is uf allowed in the above line? In Aldor that would be forbidden. What about SPAD? > lgcd:=gcd(leadingCoefficient p1, leadingCoefficient p2) > (l:=lift(f,d,uf,lgcd,lvar,ldeg,lval)) case "failed" => ["failed"] > [l :: SUPP] > 1) Suppose that for all uf in listpol, degree gcd(uf, d) is at least one. In > this case, nolift's value after the loop is true, and the function exits > with ["notCoprime"]. > > 2) Otherwise, there is a uf in listpol with degree gcd(uf, d) vanishing. In > this case, after the loop, nolift is false after the loop, and uf is the > *last* element in listpol Yep as I noted above, the line should probably be: > if degree gcd(uf,d) =0 then (nolift:=false; break) And, of course, uf should be local to the loop, so one has to introduce a separate variable that captures the element for which the gcd is constant. This program should be rejected by the compiler. Ralf ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ open-axiom-devel mailing list open-axiom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/open-axiom-devel