On Tue, Apr 8, 2008 at 4:53 AM, Gabriel Dos Reis wrote: > On Mon, Apr 7, 2008 at 11:07 PM, Bill Page wrote: > > > Yes! That is the right idea but really what we need is for the > > SPAD compiler to choose a reasonable signature for the '=' > > operation. Probably everything would work-out (almost) ok > > if the built-in 'Mapping' domain exported an operation like > > this: > > > > (f:(S,S)->S) = (g:(S,S)->S)):Boolean == EQ(f,g)$Lisp > > Mapping(S,S,S) has that. >
Interesting. The information from command )show Mapping(Integer,Integer,Integer) is quite useless in this regard. Hyperdoc (in FriCAS) is better but in OpenAxiom Hyperdoc crashes when displaying this kind of information. :-( Doing a package call to Mapping works: f(0,0)=(0+0)$S and (f = _+$S)$Mapping(S,S,S) => return 0$S but it still fails if the application is not done before calling '=' (f = _+$S)$Mapping(S,S,S) => return 0$S So however it is currently implemented in Mapping (Where do I find this in the source?), it is still deficient. I do not see any reason why this should have to be a package call. Even writing import Mapping(S,S,S) does not cause the compile to correctly interpret the '=' operation. Of course as a fundamental built-in domain 'Mapping' is *very* important to Axiom - especially when considering categorical semantics, as the Exponential object. http://en.wikipedia.org/wiki/Exponential_object It is part of what is required for basing the semantics on a cartesian closed category. I think the Mapping domain badly needs improvement in both SPAD and the Axiom interpreter to support this. > [...] > > > > OTOH I am not sure if it is supposed to actually work -- > > > equality of functions is a tricky business. One can > > > define reasonable equality for functions, but this > > > basically disables some optimizations. > > > > I think that in principle one can simply compare the names of > > the operations. But the complication is that the "names" of > > some operations in SPAD are not fully determined until their > > first application during run-time. There is a need to resolve calls > > to 'newGoGet' before comparing the names. One way to do this > > is simply to apply the functions to some arguments at least > > once before doing the comparison. E.g. > > > > f(0,0)=(0+0)$S and (f = _+$S) => return 0$S > > > > Here both 'f' and '+' are applied to a member of S before testing > > the equality. > > in my book, that is a bug. One should be able to ask for > +$S @ Mapping(S,S,S) without tears. I agree! I would be very happy to help with making these improvements. > One should be able to write code that directly maps to direct > expression of mathematical ideas without fears. At least, > when we are talking about languages for computational > mathematics. > Absolutely. I think one way to working towards this is to base the semantics more directly on categorical constructions. Regards, Bill Page. ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Register now and save $200. Hurry, offer ends at 11:59 p.m., Monday, April 7! Use priority code J8TLD2. 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