On 24.04.2022 17:14, Ralf Hemmecke wrote: > Hi Kurt, > > You do not need to create a new domain. It also fails to work with XDP in the > latest master.
I was aware about that, however, the strange thing is that this failed already in version 1.3.5. (2) -> [x,y]:=[s::XDistributedPolynomial(Symbol,EXPR INT) for s in [x,y]] (2) [x, y] Type: List(XDistributedPolynomial(Symbol,Expression(Integer))) (3) -> x*y^3 3 (3) x y Type: XDistributedPolynomial(Symbol,Expression(Integer)) (4) -> retract % >> Error detected within library code: FM1.retract impossible (4) -> )version Value = "FriCAS 1.3.5 compiled at Mi, 17. Apr 2019 03:15:11" (4) -> (4) -> retractIfCan(x*y^5); Type: Union("failed",...) (5) -> retractIfCan(x); Type: Union("failed",...) > > Actually, if I am not wrong than "A has C" only tells you that C is explicitly > mentioned in the exports of A, but not whether there is an actual > implementation > for C. Yes, I also think so, however, when it worked, as it certainly did in 1.3.5, then you wouldn't waste much time ;) > > (1) -> Expression Integer has SemiRing > > (1) true > (2) -> R ==> Expression Integer > (3) -> SYM ==> Symbol > (4) -> XDP ==> XDistributedPolynomial(SYM,R) > (5) -> [x::XDP for x in [X,Y,Z]] > > (5) [X, Y, Z] > Type: List(XDistributedPolynomial(Symbol,Expression(Integer))) > > (6) -> [a,b,c] := [x::XDP for x in [X,Y,Z]] > > (6) [X, Y, Z] > Type: List(XDistributedPolynomial(Symbol,Expression(Integer))) > (7) -> a > > (7) X > Type: XDistributedPolynomial(Symbol,Expression(Integer)) > (8) -> r := a*b^2*c^4 > > 2 4 > (8) X Y Z > Type: XDistributedPolynomial(Symbol,Expression(Integer)) > (9) -> retract r > Function: retractIfCan : % -> Union(FreeMonoid(Symbol),"failed") is missing > from domain: XDistributedPolynomial(Symbol,Expression(Integer)) > Internal Error > The function retractIfCan with signature > (Union (FreeMonoid (Symbol)) failed)$ is missing from domain > XDistributedPolynomial(Symbol)(Expression (Integer)) > > (9) -> R > > (9) Expression(Integer) > > (10) -> R has SemiRing > > (10) true > > (11) -> XDP has RetractableTo(FreeMonoid SYM) > > (11) true > > However, looking down the implementation chain tells me that retract should be > implemented through FreeModule(R,FreeMonoid SYM). But we have > > (12) -> F := FreeModule(R,FreeMonoid SYM) > > (12) FreeModule(Expression(Integer),FreeMonoid(Symbol)) > (13) -> F has RetractableTo(FreeMonoid SYM) > > (13) true > > (16) -> s := 'x::Symbol > > (16) x > Type: Symbol > (17) -> sf := s :: F > > (17) x > Type: FreeModule(Expression(Integer),FreeMonoid(Symbol)) > (18) -> retract sf > > (18) x > Type: FreeMonoid(Symbol) > > So indeed, your detected error is weird. > In fact, when you enter XDistributedPolynomial into HyperDoc browse, add the > parameters vl=Symbol and R=Expression Integer, click on Operations and then on > Implementation, it also tell you that retractIfCan is nowhere implemented. > > My suspicion is that it has something to do with the conditional > implementation > of retract in FreeModule. I faintly remember that I once had a similar issue. > > Looks like someone must use "git bisect run" to find out which commit causes > the > issue. Thanks! Kurt > > Ralf > > Ralf > -- You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group. To unsubscribe from this group and stop receiving emails from it, send an email to fricas-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/fricas-devel/4d2496dd-0200-4ac6-8afa-27ed0f9ecf30%40gmail.com.