That's a very strange bug.

I would have expected that as in the loop case that is not inside a
function, the size of the inner loop is computed once and is not
reconsidered each time x0 changes. In other words also g(3) should not
loop endlessly.

Sorry, that this just happens right before the release, but I just
stumpled over it. :-(

Oh, I just see, the outer loop is not necessary to demonstate the bug.

I haven't checked whether this is also a problem in a .spad file.

Ralf

==================================
x0 := 3
x3 := x0-1
for k3 in 1 .. x3 repeat for k0 in 1 .. x0 repeat (print x0; x0:=x0+1)

g(x1:Integer):Integer ==
    x0:Integer := x1
    x3: Integer := x1-1
    for k3 in 1 .. x3 repeat for k0 in 1 .. x0 repeat (print x0; x0:=x0+1)
    x0
g 3
==================================

(34) -> )clear completele
   No option begins with completele .
(34) -> )r loopbug.input

x0 := 3


   (34)  3
                                                        Type:
PositiveInteger
x3 := x0-1


   (35)  2
                                                        Type:
PositiveInteger
for k3 in 1 .. x3 repeat for k0 in 1 .. x0 repeat (print x0; x0:=x0+1)

   3
   4
   5
   6
   7
   8
   9
   10
   11
                                                                   Type:
Void

g(x1:Integer):Integer ==
    x0:Integer := x1
    x3: Integer := x1-1
    for k3 in 1 .. x3 repeat for k0 in 1 .. x0 repeat (print x0; x0:=x0+1)
    x0

   Function declaration g : Integer -> Integer has been added to
      workspace.
   Compiled code for g has been cleared.
   1 old definition(s) deleted for function or rule g
                                                                   Type:
Void
g 3

   Compiling function g with type Integer -> Integer
   3
   4
   5
   6
   7
   8
   9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33

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