On Tue, Apr 8, 2008 at 10:34 PM, Gabriel Dos Reis wrote:
> On Tue, Apr 8, 2008 at 7:33 PM, Bill Page wrote:
>
> http://axiom-wiki.newsynthesis.org/SandBoxMyReduceInOpenAxiom
>
>  >
>  >  ??changed:
>  >  -Notice that it fails in the same way as above, but it would work
>  >  if we used the original trick of applying the function before comparing
>  >  it.  Notice that it fails in the same way as above:
>
>  That isn't science.
>
>  The original problem is ill-defined:  what does not it mean to compare
>  two functions?
>

In another thread you suggested that the internal function named
'newGoGet' occurs only in my test package in SandBoxMyReduce. I do not
think this is the case.

The fact is that current built-in Mapping domain uses the same
definition of equality as I gave in my original code. The above web
page demonstrates the expected result that the 'myred' operation
defined in this package fails in the same way if I force the compiler
to use the definition of equality given by Mapping as when I use my
own definition - if I do not first apply the functions to be tested to
an element of the domain before testing for their equality using this
method.

>From the definition given for 'myred' as a two argument form of
'reduce' that can handle correctly (in the sense we discussed in
another thread) the case of passing an empty list to an operation from
a domain that is monoid, i.e. one which has a unique identity element,
it is clear what failure means in this case. What is required is that
the equality on functions at least allows us to determine when a given
function (like +) is an operation of such a domain which case given
the definition of the associate monoid category we can then choose the
correct identity or advise the user that this is not possible.

Applying the functions as done in the original code ensures that the
functions have been fully resolved. Without this the results of the
function equality test are too "coarse" for the purposes of the
algorithm in 'myred'. Two functions that we know to be equal are not
identified as such because one of them is still a call to 'newGoGet'.

'newGoGet' is defined in 'nrunfast.boot'. Here we see that 'newGoGet'
calls 'replaceGoGetSlot' to resolve the operation before actually
calling it. We can set:

 )lisp (setq |$monitorNewWorld| t)

to see this happen. I think I would like to call 'replaceGoGetSlot
env' inside MappingEqual to make sure that the resolution is done
before the comparison. But I am rather lost in this code and do not
know to construct 'env' for this call in the context of MappingEqual.
Any help or suggestions would be appreciated.

Regards,
Bill Page.

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
open-axiom-devel mailing list
open-axiom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open-axiom-devel

Reply via email to