Hi all,
Is there a smarter way than the following to write lexorder?(p,q) ?
lexorder?(p,q) ==
if empty?(variables(p))
then return ~empty(variables(q))
else
vars := members(difference( set(variables( secret1*p + secret2*q)),
set([secret1, secret2])))
a := members(degree( p::DMP(vars,?) ))
b := members(degree( q::DMP(vars,?) ))
return negative?( first(a) - first(b) )
My first attempt used:
vars := sort(members(union(set(variables(p), variables(q)))))
but was surprised to see
> sort([x,y,z])
[z,y,x]
> sort([x,z,y])
[y,z,x]
and thus made up the secret-trick in order to avoid sort.
--
Jens Axel Søgaard
_______________________________________________
Axiom-mail mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/axiom-mail