#12969: Coercion failures in symmetric functions
-------------------------------------------------+--------------------------
Reporter: aschilling | Owner: sage-combinat
Type: defect | Status: needs_review
Priority: major | Milestone: sage-5.3
Component: combinatorics | Resolution:
Keywords: symmetric functions, coercion | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Simon King | Merged in:
Dependencies: | Stopgaps:
-------------------------------------------------+--------------------------
Comment (by SimonKing):
It turns out: When making a special case when py_scalar_parent is None,
then indeed ''in our example'' it is always the case that the starting
point of a coerce path we are looking for is the same as the starting
point of any path we temporarily disregard. This is how it should be. I
will update my patch a bit later.
However, when starting Sage, it is still the case that the path from
`Number Field in I with defining polynomial x^2 + 1` to `Rational Field`
is blocked while searching for a path from `Complex Lazy Field` to
`Integer Ring`, or `Algebraic Field` to `Real Field with 53 bits of
precision` is blocked while searching for `<type 'float'>` to `Algebraic
Field`.
But I think I understand that as well: When searching for a coercion from
P to, e.g., the complex field CC, the first thing the coercion model does
is to temporarily disregard (P,CC) for the backtracking algorithm. Then,
`CC._coerce_map_from_(P)` is called at some point. But the last line of
that method calls `CC._coerce_map_via([CLF],P)`. Hence, while (P,CC) is
still disregarded, not only a coerce path from P to CLF but also a coerce
path from CLF to CC is sought.
I tend to say that it is the responsibility of the person writing
`_coerce_map_from_` for a parent to avoid ill effects.
Therefore, I still think that the solution of my patch ("do not cache the
absence of a coerce path from A to B if there is any temporarily
disregarded path that stars at A") is fine. If the reviewer disagrees then
we may consider a very strict solution: "do not cache the absence of a
coerce path from A to B if there is any temporarily disregarded path
besides (A,B) itself."
Thoughts?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12969#comment:34>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" 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/sage-trac?hl=en.