Ralf Hemmecke wrote:
>
> Another status update.
>
> I'm near to complete a fix to ax.boot.
>
<snip>
> I actually would have liked to replace the flag in this position with
> my new machinery. Unfortunately, it seems to be impossible. This all
> has to do with operations in category defaults.
>
> Look for example at VectorCategory. It has a default package that
> looks like this.
>
> VectorCategory(R:Type): Category == OneDimensionalArrayAggregate R
> with
> ...
> if R has RadicalCategory and R has Ring then
> length: % -> R
> ++ length(v) computes the sqrt(dot(v,v)), i.e. the magnitude
> magnitude: % -> R
> ++ magnitude(v) computes the sqrt(dot(v,v)), i.e. the length
> add
> ...
> if R has RadicalCategory and R has Ring then
> length p ==
> sqrt(dot(p,p))
> magnitude p ==
> sqrt(dot(p,p))
>
> But it seems that FriCAS doesn't store the "if R has ... then"
> conditions.
>
> (1) -> )boot name := hasDefaultPackage('VectorCategory)
> (EVAL-WHEN (EVAL LOAD) (SETQ |name| (|hasDefaultPackage| '|
> VectorCategory|)))
> Value = |VectorCategory&|
> (1) -> )boot GETDATABASE(name, 'CONSTRUCTORMODEMAP)
> (EVAL-WHEN (EVAL LOAD)
> (PROG () (RETURN (GETDATABASE |name| 'CONSTRUCTORMODEMAP))))
> Value = (((|VectorCategory&| |#1| |#2|)
> (CATEGORY |domain| (SIGNATURE |magnitude| (|#2| |#1|))
> (SIGNATURE |length| (|#2| |#1|))
> (SIGNATURE |cross| (|#1| |#1| |#1|))
> (SIGNATURE |outerProduct| ((|Matrix| |#2|) |#1| |#1|))
> (SIGNATURE |dot| (|#2| |#1| |#1|)) (SIGNATURE * (|#1| |#1| |
> #2|))
> (SIGNATURE * (|#1| |#2| |#1|)) (SIGNATURE * (|#1| (|
> Integer|) |#1|))
> (SIGNATURE - (|#1| |#1| |#1|)) (SIGNATURE - (|#1| |#1|))
> (SIGNATURE |zero| (|#1| (|NonNegativeInteger|)))
> (SIGNATURE + (|#1| |#1| |#1|)))
> (|VectorCategory| |#2|) (|Type|))
> (T |VectorCategory&|))
>
> If that is true, it's not (yet) completely bad since I would simply
> use the old machinery for this cases (and for the current algebra
> library that still works).
>
> However, the old machinery is inherently wrong (IMHO), since it simply
> looks at the involved type constructors and pretends their arguments
> to be of the correct type regardless of the actual stuff that appears
> in the "has" expression.
>
> So, if FriCAS indeed doesn't store the signature as above, I'm out of
> luck, otherwise please let me know how I can extract the "if"
> structure of the default package.
>
I am affraid that indeed FriCAS does not store conditions in
export lists of default packages. I remember a place in
compiler which essentialy throws away all such conditions,
and it seems that this is want gets stored. I tried to
keep conditions, but currently this is too complicated
for Spad compiler. Throwing away conditions is causing some
problems, but they are handled (partialy ...) in a special way.
--
Waldek Hebisch
[email protected]
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/fricas-devel?hl=en.