What is a pretty good way to represent non-finite sets such as
{n * %pi | n in Z}, where Z is the set of integers? I have an experimental
extension to to_poly that needs to represent such sets. It's
easy to dream up elaborate schemes that would require dozens of
patches to Maxima innards, but I don't want to do that. The version du
jour uses (my) dot-dot operator:
(%i53) xsolve(sin(x)=1/2,x);
(%o53) [x=2*%pi*(-inf..inf)+(5*%pi)/6] or [x=2*%pi*(-inf..inf)+%pi/6]
(%i54) make_instance(%);
(%o54) [x=2*%pi*%k140+(5*%pi)/6] or [x=2*%pi*%k141+%pi/6]
(%i55) xsolve(sin(x) * cos(x) =1/2,x);
(%o55) [x=-(-2*%pi*(-inf..inf)-%pi/2)/2]
(%i56) make_instance(%);
(%o56) [x=-(-2*%pi*%k144-%pi/2)/2]
I could skip the dot-dot stuff and immediately go to (%o54). That
would make equality testing (rtest files) harder to write. A few
things I don't like: The "=" in x=2*%pi*(-inf..inf)+%pi/6 isn't really
what I'd like, but inventing a new operator would require a whole
bunch of patches here and there, I think.
We don't want (minf .. inf) - (minf .. inf) --> 0, so I put a hidden
gensym into the dot-dot operator argument list; I'll need to change
is(equal(...)) to ignore the hidden gensym; that's no big deal.
Barton