I found the following bug in the basis List domain:

(121) -> li := [5,6,7,8,9]

   (121)  [5,6,7,8,9]
                                                  Type:
List(PositiveInteger)
(122) -> delete!(li,1)

   (122)  [6,7,8,9]
                                                  Type:
List(PositiveInteger)
(123) -> li

   (123)  [5,6,7,8,9]
                                                  Type:
List(PositiveInteger)
(124) -> delete!(li,1)

   (124)  [6,7,8,9]
                                                  Type:
List(PositiveInteger)
(125) -> delete!(li,1)

   (125)  [6,7,8,9]
                                                  Type:
List(PositiveInteger)
(126) -> delete!(li,1)

   (126)  [6,7,8,9]
                                                  Type:
List(PositiveInteger)
(127) -> delete!(li,2)

   (127)  [5,7,8,9]
                                                  Type:
List(PositiveInteger)
(128) -> delete!(li,2)

   (128)  [5,8,9]
                                                  Type:
List(PositiveInteger)
(129) -> delete!(li,2)

   (129)  [5,9]
                                                  Type:
List(PositiveInteger)
(130) -> delete!(li,2)

   (130)  [5]


The reason is in the following code:

   delete!(x : %, i : Integer) ==
       i < (m := minIndex x) => error "index out of range"
       i = m =>  rest x
       y := rest(x, (i - 1 - m)::NonNegativeInteger)
       setrest!(y, rest(y, 2))
       x

for category ListAggregate

where the case i = m (=1) does return rest x as desired, but not destructively, 
while this is done for the other cases via setrest!

As destructive list changes are done via LISP operations I have to leave it to 
the experts for that to fix this bug.

-- 


Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-3224-192688

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to