> The other part where I'm stuck is the function
> 
>     rows(A:M, si:SPI) : M

> )show Segment
>  ...
>  expand : % -> List(S) if S has ORDRING

And there lies the reason for why your code does not compile.

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))

> (1) -> PI has ORDRING
> 
>    (1)  false

> This means I can not expand a Segment(PI) into a List?

Exactly.

> 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.

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.

Ralf

-- 
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