#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           |  f837cbee8f81c4946a92193c73e86449c53515d9
   Dependencies:  #14711             |     Stopgaps:
-------------------------------------+-------------------------------------
Changes (by {'newvalue': u'Simon King', 'oldvalue': ''}):

 * status:  new => needs_review
 * author:   => Simon King


Comment:

 I have pushed a new commit that implements version numbers for the
 coercion cache, and I added a doctest along the following lines:
 {{{
 sage: class pA(Parent): pass
 sage: class pB(Parent): pass
 sage: class pC(Parent): pass
 sage: A=pA(); B=pB(); C=pC()
 sage: BtoA=Hom(B,A)(lambda x: A(x))
 sage: AtoC=Hom(A,C)(lambda x: C(x))
 sage: A.register_coercion(BtoA)
 sage: C.coerce_map_from(B)
 sage: A.register_embedding(AtoC)
 sage: C.coerce_map_from(B)
 Composite map:
   From: <class '__main__.pB'>
   To:   <class '__main__.pC'>

         WARNING: This map has apparently been used internally
         in the coercion system. It may become defunct in the next
         garbage collection. Please use a copy.
 }}}

 Hence, I think that the current commit solves our problem. In spite of the
 following "todo" list, I put it to "needs review" (but I am sure that
 further commits will be pushed soon).

 TODO:

 - Add documentation, stating that registering of coercions should ''only''
 be done during initialisation, and that registering of embeddings
 shouldn't be done too often.
 - Run all doctests---since playing with the coercion digraph is asking for
 trouble, I wouldn't be surprised about bad surprises `:-P`
 - '''Important:''' Get timings for examples that should be most sensitive
 against slow-downs in coercion.

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