ALICe documentation

Model wise

«  Model while2   ::   Contents

Model wise

Cited in: [AliasDFG10].

Tag: complexity.

Figure

../_images/wise.png

Source code

model main {

  var x, y;

  states start, lbl_9_1, lbl_8_1, stop;

  transition t_25 := {
    from   := start;
    to     := lbl_9_1;
    guard  := y + 3 <= x && 0 <= y;
    action := y' = y + 1;
  };

  transition t_24 := {
    from   := start;
    to     := lbl_8_1;
    guard  := x + 3 <= y && 0 <= x;
    action := x' = x + 1;
  };

  transition t_23 := {
    from   := start;
    to     := stop;
    guard  := x <= y + 2 && 0 <= x && y <= x + 2 && 0 <= y;
    action := ;
  };

  transition t_13 := {
    from   := start;
    to     := stop;
    guard  := x + 1 <= 0 || y + 1 <= 0;
    action := ;
  };

  transition t_21 := {
    from   := lbl_9_1;
    to     := lbl_8_1;
    guard  := x + 3 <= y;
    action := x' = x + 1;
  };

  transition t_20 := {
    from   := lbl_9_1;
    to     := stop;
    guard  := x <= y + 2 && y <= x + 2;
    action := ;
  };

  transition t_22 := {
    from   := lbl_9_1;
    to     := lbl_9_1;
    guard  := y + 3 <= x;
    action := y' = y + 1;
  };

  transition t_19 := {
    from   := lbl_8_1;
    to     := lbl_9_1;
    guard  := y + 3 <= x;
    action := y' = y + 1;
  };

  transition t_17 := {
    from   := lbl_8_1;
    to     := stop;
    guard  := x <= y + 2 && y <= x + 2;
    action := ;
  };

  transition t_18 := {
    from   := lbl_8_1;
    to     := lbl_8_1;
    guard  := x + 3 <= y;
    action := x' = x + 1;
  };

}

strategy main_s {

  Region init := {state = start};

}

Expected invariant

{ lbl_9_1[v1, v2] : v2 <= -2 + v1 and v2 >= 1; lbl_8_1[v1, v2] : v1 >= 1 and v2 >= 2 + v1 }

Results

  • With Aspic: { lbl_9_1[x, y] : y <= -2 + x and y >= 1; stop[x, y]; lbl_8_1[x, y] : x >= 1 and y >= 2 + x; start[x, y] } (0.09s), OK.
  • With ISL: { stop[x__1, y__1] : y__1 <= -1 or x__1 <= -1 or (y__1 >= -2 + x__1 and x__1 >= 0 and y__1 <= 2 + x__1 and y__1 >= 0); stop[x__1, 2 + x__1] : x__1 >= 1 or x__1 >= 2; stop[x__1, -2 + x__1] : x__1 >= 3 or x__1 >= 4; lbl_9_1[x__1, y__1] : (y__1 <= -2 + x__1 and y__1 >= 1) or (y__1 <= -2 + x__1 and y__1 >= 2); start[x, y]; lbl_8_1[x__1, y__1] : (y__1 >= 2 + x__1 and x__1 >= 1) or (y__1 >= 2 + x__1 and x__1 >= 2) } (0.02s), OK.

«  Model while2   ::   Contents