This is definitely a bug, though I'm not sure as to the cause (I
thought this used to work, but the register_* commands aren't as well
developed or tested as the Parent-provided ones).

On Mon, Oct 14, 2013 at 9:49 AM, Nils Bruin <nbr...@sfu.ca> wrote:
> On #14711 we ran into an existing difference with how coercions that are
> "embeddings" are handled in coercion discovery:
>
> class pA(Parent): pass
> class pB(Parent): pass
> class pC(Parent): pass
>
> A=pA(); B=pB(); C=pC()
>
> BtoA=Hom(B,A)(lambda x: A(x))
> AtoC=Hom(A,C)(lambda x: C(x))
> A.register_coercion(BtoA)
> A.register_embedding(AtoC)
>
> G=get_coercion_model()
> G.discover_coercion(A,C) #finds AtoC
> G.discover_coercion(B,A) #finds BtoA
> G.discover_coercion(B,C) #does not find the composition of BtoA with AtoC
>
> If we use C.register_coercion(AtoC) instead, then all discoveries succeeds.
> We are working on the assumption that the
> coercion system is modeled by a directed graph on the parents and that a
> coercion exists iff there is a path from the domain to the codomain.
> It seems register_embedding isn't adding edges that are fully recognized.
>
> Is this intentional or is this a "bug" in the coercion system? In particular
> Robert Bradshaw's opinion (as original author) would be very helpful.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to