Fourier elimination



On 12/7/07, Stavros Macrakis <macrakis at alum.mit.edu> wrote:

> I like the idea of explicit boolean connectives; on the other hand, I find
> it obscure that Maxima currently doesn't parenthesize them on output. I
> would find the following much clearer and easier to read:
>
>     x == 0 or (0 < x and x < 6/11) or (-6/11 < x and x < 0) or 6/11 < x or x
> < -6/11

Well, the lack of parentheses is to be expected since "and"
has greater binding power than "or". Here's a modification of
DIMNARY (called from DIMENSION-NARY) which makes Maxima
more eager to put in parentheses:

(defun dimnary (form result lop op rop w)
  (if (not (atom form))
    (dimension-paren form result)
    (dimension form result lop rop w right)))

So far as I can tell, that affects only these operators:
MOR MCOMMA MNCTIMES MTIMES MAND

I don;'t think that causes any incorrect outputs, but whether the
number of parentheses is appropriate is a matter of taste.
DIMNARY as defined above seems to encourage a tasteful
amount of parentheses. Maybe someone else can try it.

>           (I'm using x==0 to mean equal(x,0); remember that x=0 is false...)

It seems like x=0 should be OK, since Maxima understands that in
input to indicate an equation, and not a Boolean expression ...
But Maxima conflates a couple of different notions of "=" so maybe
we should introduce a new operator "==" to distinguish them.

> > or stuff like foo < x and x < bar could be turned into interval objects,
> > x = 0 or x in open_interval (0, 6/11) or ...
>
> Until we have a functional interval package (you aren't hiding something
> from us, are you?), I don't see the point of this.

Well, at present open_interval or any notation like that is speculative,
but it seems useful to talk about how that could work.
Compared to some of the known tasks (fixing the limit code, etc)
inventing a new kind of object is much simpler.

> > Or maybe the result should be a set?
> >
> > {x = 0, x in open_interval (0, 6/11), x in open_interval (...), ...}
> >
>
> Huh? I think you mean something like
>
>      x in union({0},open_interval (0, 6/11), open_interval (...) }

What I'm getting at here is that instead of a list of equations or
inequalities, the result should be a set, since order doesn't matter.
That, at least, Maxima already knows about.

best

Robert