Hi,

> The following works, but is (of course) not the right solution.
> 
>     rows(A:M, si:SPI) : M ==
>       rows(A, (expand(si pretend Segment(Integer))$Segment(Integer))
> pretend List(PI))

Yes, this would work.

> > (1) -> PI has ORDRING
> > 
> >    (1)  false
> 
> > This means I can not expand a Segment(PI) into a List?
> 
> Exactly.

Too bad. OTOH the interpreter can do it without any hassle.
 
> > Why not, it seems to be a natural operation, no?
> 
> Right, but the current library implementation is unnecessarily
> restrictive.
> 
> I guess for "expand" we only need OrderedSet, a distinct element 1
> (default step size) and an operation +. In fact, disregarding the "by"
> construction of a segment, a function next: %->% would be enough.

Maybe we should try to lessen these restrictions?
What do you think about this, would it be feasible
or rather introduce new trouble somewhere?

> Anyway, the current implementation gets the 1 and + from OrderedRing.
> 
> So without changing the library you would have to locally implement
> "expand" for Segment(PositiveInteger)
> 
> Take a look at
> https://github.com/hemmecke/fricas/blob/master/src/algebra/seg.spad.pamphlet#L150
> and modify the respective types for your local myexpand: SPI -> LPI
> function.

Thanks for the precise hint. I did that and it works very well.

https://github.com/raoulb/fricas_code/blob/master/mama/MAMA.spad#L152

The only point I'm not sure is the use of "qcoerce". It this ok?
I have seen this in other parts of the Fricas source.

The downside is that this "qcoerce" makes the OpenAxiom
compiler complaining.



And by the way, the help for "coerce" is not helpful:

(87) -> )display op coerce

There are 86 exposed functions called coerce :
   [1] D1 -> D from D if D has ALGEBRA(D1) and D1 has COMRING
 
   >> System error:
   The value D2 is not of type SEQUENCE.

What happens here? I think this is a bug, isn't it?

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" 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/fricas-devel?hl=en.

Reply via email to