Martin Rubey wrote:
>
> Waldek Hebisch <[EMAIL PROTECTED]> writes:
>
> > I agree that we should check for identity. Consequently isExpt(x, sy)
> > should be removed. However, I am not sure if we should remove
> > isExpt(x, op) and is?.
>
> OK, but only if we make "is?" always check only the name (as in BOP), and
> isExpt always check for identity.
>
Yes, isExpt(x, op) checks identity. Concerning is?, I wonder why we
check for name, at first glace such check looks wrong. Maybe this is
(misguided) speed optimization (equality of operators used to be
expensive) or maybe original code assumed that operators with different
names are "the same" operator.
> > Namely, is? and isExpt (and few related functions) form a useful
> > abstraction:
> > they are used to implement "pattern matching" on expressions -- use of is?
> > gives us extra clue compared to =. Also, I think that we should think twice
> > before we "spell out the code": when we use aproprate function we have only
> > single place to read/correct/modify. Once we expand code we need to search
> > all source for occurences.
>
> I agree, but I think this applies only for isExpt(x), which I certainly do not
> want to remove. Concerning is?, I only want consistent meaning -- i.e., check
> for name equality only.
>
> > A bit different story is is?(k, sy) versus is?(k, op): my first impression
> > is
> > that for example in transsolve we also should check operator identity. It
> > would be good to sort out this.
>
> That was precisely my idea.
>
> > One more remark: IIRC operator stuff is on "critical path", that is its
> > speed
> > visibly affects speed of expression manipulation. I certainly want to do
> > thing correctly, even if it is slower, but it would be silly to remove some
> > specific function and re-introduce them later to gain speed.
>
> Default implementations on category level (as isExpt) are heavily penalized,
> because they cannot be inlined. So removing the two argument form of isExpt
> should not make FriCAS slower.
>
> So, I propose to agree on one or the other:
>
> (A)
>
> > * remove is? entirely from BasicOperator, Kernel and ExpressionSpace,
> > because
> > it's name is misleading.
> >
If name is problematic we can rename is? to something else.
> > * remove the two-argument form of isExpt.
> >
> > * spell out occurrences of isExpt(a, op). I think the following translation
> > would be acceptable.
> >
> > I think that testing for equality is correct most of the time...
> >
> > * replace is?(op, sy) by op.name = sy and is?(op1, op2) by op1 = op2, as
> > appropriate. Most of the time it should become the second form, I think.
>
>
> (B)
>
> * remove is?(f, op) in ExpressionSpace and Kernel (these check for identity,
> which is not consistent with BOP)
>
> * remove the two-argument form of isExpt.
>
> * spell out occurrences of isExpt(a, op).
>
> (C)
>
> * remove is?(f, op) in ExpressionSpace and Kernel (these check for identity,
> which is not consistent with BOP)
>
I wonder why you think that is?(f, sy) is the one to save? Presonally,
this version was a bit misleadig for me (before I got used to it), not
the others. I would say that hasName?(f, sy) would be much clearer.
> * remove isExpt(x, sy).
>
--
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
-~----------~----~----~----~------~----~------~--~---