grrr: strange behaviour of 'assume'

Axel Vogt's picture
This behaviour of 'assume' puzzles me ... 
and it needed some time to locate it
 
  restart; interface(version);

  Classic Worksheet Interface, Maple 12.00, Windows, Apr 10 2008 Build ID 347164

  assume(a::real); 
    #a:='a'; # activating removes the problem
  f0:=x+a; 
    #a:='a'; # that would not help - since is in use?
  assume(0<a);
  f:=collect(f0,x);

                             f0 := x + a
                              f := x + a

  eval(f,a=1); indets(%);

                                x + a
                                {a,x}

In words: using assuming and assigning in the above way
prevents Maple from treating as what I consider a variable.

www.mapleprimes.com/files/102_strange_assume.mws

It is "design"

By attaching a property to 'a' its value is an internal variable (that prints like a~ when interface(showassumed=1) ). So, the value of 'f0' is 'x+a~'. Then 'f' is not assigned an expression with the symbol 'a' but with the symbol 'a~'...

For some notes on that I have collected on related issues see this page at the Maple wiki.

Axel Vogt's picture

perplexing ... ahem: intriguing

But it means, one can not over-write assumptions. Sigh ...

overwrite

You do overwrite assumptions by assigning a different value to 'a'. Ie 'assume(0<a)' assigns to 'a'  a second  variable 'a~' which is another index to the table `property /object`:

assume(a::real); 
`property/object`[a];
                                 real

assume(0<a);
`property/object`[a];
                     RealRange(Open(0), infinity)

JacquesC's picture

A known sub-optimal design

This part of the low-level design of 'assume' was known to be a hack, but it was the best hack that mostly-worked available at the time (Maple's assume facility is now rather old).  Maple has evolved since, and newer features (like attributes) would have been a much better low-level implementation strategy for assume.  But that would have introduced all sorts of subtle backwards compatibility problems, even though it generally would have been an improvement.

This is the cost one must bear for total backwards compatibility: old design bugs can rarely be fixed.  This causes a lot of inertia for old software, and over time it can lead to serious sclerosis.  In other areas, this has allowed newer competitors a foothold even though the start-up cost is tremendous [think operating systems as the most obvious example].

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}