ALICe documentation

Model counters1

«  Model counterex1   ::   Contents   ::   Model counters2  »

Model counters1

Cited in: [GulwaniMC09] fig. 3 p. 6.

Tag: complexity.

Figure

../_images/counters1.png

Source code

model gulwani_mehra_chilimbi_popl09_06a {

  var x, n, c;

  states q1, q2;

  transition t1 := {
    from   := q1;
    to     := q2;
    guard  := x < n;
    action := ;
  };

  transition t3 := {
    from   := q2;
    to     := q1;
    guard  := true;
    action := x' = x + 1, c' = c + 1;
  };

  transition t2 := {
    from   := q2;
    to     := q1;
    guard  := true;
    action := x' = x + 1, c' = c + 1;
  };

}

strategy gulwani_mehra_chilimbi_popl09_06a_s {

  Region init := {state = q1 && x = 0 && c = 0 && n >= 0};

}

Expected invariant

{ q2[v1, v2, v3] : v3 <= v2; q1[v1, v2, v3] : v3 <= v2 }

Results

  • With Aspic: { q2[x, n, x] : x >= 0 and n >= 1 + x; q1[x, n, x] : x >= 0 and n >= x and n >= 0 } (0.05s), OK.
  • With ISL: { q2[x__1, n__1, x__1] : n__1 >= 0 and n__1 >= 1 + x__1 and x__1 >= 0; q1[x__1, n__1, x__1] : n__1 >= 0 and n__1 >= x__1 and x__1 >= 1; q1[0, n, 0] : n >= 0 } (0.01s), OK.

«  Model counterex1   ::   Contents   ::   Model counters2  »