#15303: Coercion discovery fails to be transitive
-------------------------------------+-------------------------------------
Reporter: nbruin | Owner:
Type: defect | Status: needs_review
Priority: major | Milestone: sage-5.13
Component: coercion | Resolution:
Keywords: | Merged in:
Authors: Simon King | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/SimonKing/ticket/15303 | 5c0800a07bd83787e59713236e5ccc8dde434760
Dependencies: #14711 | Stopgaps:
-------------------------------------+-------------------------------------
Changes (by SimonKing):
* status: needs_work => needs_review
* work_issues: Implement backtracking properly =>
Comment:
Replying to [comment:65 nbruin]:
> Unfortunately, that doesn't seem to be a very good heuristic because
it's not stable: `_coerce_map_from_` is supposed to do some backtracking
on its own, so if `A._coerce_map_from(B)` happens to consider another
parent `C` that coerces into `A` and find that
`C._coerce_map_from(B)==True`, it would return an explicit composite map,
with the generic conversion from B into C as one of the components. This
map would receive preference, but this map should be even less attractive
because on top of a generic conversion, it is also composed with some
other map.
Why should `A._coerce_map_from(B)` return anything? Aren't you rather
talking about `A.discover_coerce_map_from(B)` that recurses to C and thus
calls `C._coerce_map_from_(B)`?
In any case, I have now pushed my recent commits. I did solve the
recursion error with embedded number field morphism (solution: Raise a
`TypeError` if one of the number fields actually is not embedded), and
with this change
{{{
sage: L.<i> = NumberField(x^2 + 1)
sage: K = NumberField(L(i/2+3).minpoly(), names=('i0',),
embedding=L(i/2+3))
}}}
works like a charm. I don't know yet whether it results in other problems,
but in any case I'll revert to "needs review" now.
--
Ticket URL: <http://trac.sagemath.org/ticket/15303#comment:67>
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.