#15303: Coercion discovery fails to be transitive
----------------------------+-------------------------
       Reporter:  nbruin    |        Owner:
           Type:  defect    |       Status:  new
       Priority:  major     |    Milestone:  sage-5.13
      Component:  coercion  |   Resolution:
       Keywords:            |    Merged in:
        Authors:            |    Reviewers:
Report Upstream:  N/A       |  Work issues:
         Branch:            |       Commit:
   Dependencies:  #14711    |     Stopgaps:
----------------------------+-------------------------

Comment (by SimonKing):

 With the branch that I have just attached, one gets
 {{{
 sage: class pA(Parent): pass
 sage: class pB(Parent): pass
 sage: class pC(Parent): pass
 sage:
 sage: A=pA(); B=pB(); C=pC()
 sage:
 sage: BtoA=Hom(B,A)(lambda x: A(x))
 sage: AtoC=Hom(A,C)(lambda x: C(x))
 sage: A.register_coercion(BtoA)
 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.
 }}}

 What has been done in the patch:
 - renaming of attributes (`_coerce_from_backtracking` etc)
 - do not use a list, but use a `MonoDict` for all morphisms that are
 supposed to be fundamental for backtracking. There is a list
 `_registered_domains`, so that domains of registered coercions are kept
 alive by the codomain, but the domain of a registered embedding is ''not''
 kept alive by the codomain.


 Missing: Tests and versioning.

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