#15303: Coercion discovery fails to be transitive
-------------------------------------+-------------------------------------
Reporter: nbruin | Owner:
Type: defect | Status: needs_work
Priority: major | Milestone: sage-5.13
Component: coercion | Resolution:
Keywords: | Merged in:
Authors: Simon King | Reviewers:
Report Upstream: N/A | Work issues: Implement
Branch: | backtracking properly
u/SimonKing/ticket/15303 | Commit:
Dependencies: #14711 | 74821fe5409c3104b5d6eb7407a8287d54170df9
| Stopgaps:
-------------------------------------+-------------------------------------
Comment (by SimonKing):
As it turns out, the recursion again occurs when ''calling'' (not when
''constructing''!) a coerce map. Nevertheless, I think one should speed-up
the backtracking based on comparison by identity. Perhaps one could even
use a `TripleDict` for storage of temporarily forbidden paths.
The problematic map is a `DefaultConvertMap_unique`, and this could
explain why the problem arose now: In vanilla Sage, this kind of maps is
only returned if the backtracking finds nothing better.
But in one of my commits, I made sure that the backtracking is not
attempted if `self._coerce_map_from_(S)` returns `True` or returns an
actual map. The rationale for this change was that
`self._coerce_map_from_(S)` is an answer given by a specific object and
should just be preferred over an answer given by a general backtracking
algorithm. As it turns out, Sage relies on the assumption that
backtracking usually is better.
In other words: In vanilla Sage, dependencies between arrows of the coerce
digraph are implicitly declared by
- choosing an order of registered coercions
- avoiding `DefaultConverMap` and friends.
I am not happy about the existing way of implicit declaration of
dependencies and think we should do better!
--
Ticket URL: <http://trac.sagemath.org/ticket/15303#comment:52>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.