Bug #298

simple for-loops break because of "Too much unguarded recursion!"

Added by Nikolai Käfer over 4 years ago. Updated over 2 years ago.

Status:ClosedStart date:06/22/2016
Priority:NormalDue date:
Assignee:Sebastian Biewer% Done:

0%

Category:-
Target version:-

Description

The LTS of the following pseuco code can't be explored due to "Too much unguarded recursion!". (Replacing the 100 with something smaller than 90 works just fine)

mainAgent {
    int z = 0;

    for (int i = 0; i < 100; i++) {
        z += i;
    }
    println(z);
}

The CCS coded produced is

MainAgent[a] := MainAgent_1[a, 0, 0]
MainAgent_1[a, $z, $i] := when (!($i<100)) MainAgent_2[a, $z] 
                        + when   ($i<100)  MainAgent_1[a, $z+$i, $i+1]
MainAgent_2[a, $z] := println!($z).0

MainAgent[1] \ {*, println, exception}

The problem could be fixed by inserting a tau in MainAgent_1:

MainAgent_1[a, $z, $i] := i. (when (!($i<100)) MainAgent_2[a, $z] 
                            + when   ($i<100)  MainAgent_1[a, $z+$i, $i+1])

however this might break something else I'm not aware of.

History

#1 Updated by Sebastian Biewer over 2 years ago

  • Status changed from New to Closed

Also available in: Atom PDF