#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 nbruin):

 Replying to [comment:63 SimonKing]:
 > Well, the point I wanted to make is: One needs to construct the maps,
 because only the map know about their costs.

 Don't we almost always have the map in hand? When we find the map as a
 registered coercion or embedding, we can readily read off the cost. We can
 also do that when we get a map back from `_coerce_map_from_`. The only
 case where we have to estimate the cost is when we get the existence of a
 map via `K._coerce_map_from_(L)==True`, but in that case I expect the cost
 is a fixed number anyway, because it's a generically constructed map.

 I assume that the cost of a composition is the sum of the costs of the
 composed maps, because otherwise we are not working on a weighted digraph.

 That means we can simply sum the costs of the edges to get the cost of a
 path. No need to compute the "composition" of the maps explicitly until we
 actually need it.

 Your "don't consider other maps coming into `K` if we're getting an actual
 map back from `K._coerce_map_from_(L)`" is then simply an assumption that
 `K._coerce_map_from_(L)` returns the cheapest map available. I think it
 helps making such assumptions about the coercion discovery algorithm
 explicit.

--
Ticket URL: <http://trac.sagemath.org/ticket/15303#comment:64>
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.

Reply via email to