#12969: Coercion failures in symmetric functions
-------------------------------------------------+--------------------------
       Reporter:  aschilling                     |         Owner:  sage-combinat
           Type:  defect                         |        Status:  new          
       Priority:  major                          |     Milestone:  sage-5.3     
      Component:  combinatorics                  |    Resolution:               
       Keywords:  symmetric functions, coercion  |   Work issues:               
Report Upstream:  N/A                            |     Reviewers:               
        Authors:                                 |     Merged in:               
   Dependencies:                                 |      Stopgaps:               
-------------------------------------------------+--------------------------

Comment (by SimonKing):

 I think I can explain (and thus, solve) the problem!

 The bug is in the backtracking algorithm for finding a coercion path.

 Every parent A has a list of other parents B1, B2, ... such that a
 coercion from B1, B2 to A is registered. When searching for a coercion
 from parent X to A, and a direct coercion is not registered, then a
 coercion from X to B1, B2, ... is (in that order!) is searched. But of
 course one must avoid infinite recursions, and thus any coercion path from
 X to B1, B2, via X is disregarded. Disregarding one node in the
 backtracking algorithm is the purpose of _register_pair in
 sage.structure.parent.

 Now consider the following situation, where arrows denote registered
 coercions (partially the coercions are registered in ''both'' directions -
 that's what happening in the symmetric functions code):
 {{{
   X -> B2 <-> A <-> B1
 }}}

 We first ask for a coercion from X to A.

 There is no coercion from X to A found in the cache. Thus, we disregard
 (X,A) in our backtracking algorithm, and search for a coercion from X to
 B1. The only coercion path from X to B1 would be via A, but that is
 disregarded in the backtracking algorithm. The absence of a coercion from
 X to B1 is cached. In the next step, a coercion from X to A via B2 is
 found, cached and returned.

 But when later asking for a coercion from X to B1, the cache states that
 there is no coercion!

 Here's the bug: The absence of a coercion from X to B1 must ''only'' be
 cached if X is not the starting point of any disregarded search path (such
 as (X,A) in the example above), with the only exception of (X,B1).

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12969#comment:18>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to