Skip to content

Commit

Permalink
fischer example with forall in properties
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaz1502 committed May 16, 2024
1 parent 3b14509 commit bac8e02
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
41 changes: 41 additions & 0 deletions tests/testcases/templates/properties/fischer.imi
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
var
id : int;
k = 2 : constant;
IDLE = -1 : int;
N = 3 : int;

synt_var
x : clock array (N);

template p(i : int)

loc A: invariant True
when id = IDLE do { x[i] := 0 } goto req;

loc req: invariant x[i] <= k
when x[i] <= k do { x[i] := 0; id := i } goto waiting;

loc waiting: invariant True
when id = IDLE do { x[i] := 0 } goto req;
when id = i & x[i] > k goto cs;

loc cs: invariant True
when True do { id := IDLE } goto A;

end

forall i in [0, N - 1]: instantiate p[i] := p(i);

init := {

discrete =
forall i in [0, N - 1]: loc[p[i]] := A,
id := IDLE,
;

continuous =
forall i in [0, N - 1]: x[i] = i &
;
}

end
1 change: 1 addition & 0 deletions tests/testcases/templates/properties/fischer.imiprop
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
property := #synth AGnot(forall i in [0, N - 1]: loc[p[i]] = cs)

0 comments on commit bac8e02

Please sign in to comment.