-- compute others_vars[i], and call split-invariant calculator Proc doit(); Settime; -- start timing Print "step 1: set others-vars(i), for all i in 1..N.\n"; For (i in 1...N) Let others_vars[i] := vset(); For (j in 1...N) If ((j != i)) Let others_vars[i] := vset(others_vars[i],loc[j],cnt[j]); End End End Print "step 2: showing others_vars\n"; For (i in 1...N) Print "others vars for index ",i, " = ",others_vars[i]; End Print "step 3: setting correctness property\n"; -- mutex: works for N=4 and only loc. variables. -- Let prop := & for (i=1;i<=N;i=i+1) {& for (j=1;j<=N;j=j+1) {i=j | loc[i] != 10 | loc[j] != 10}}; -- bounded overtaking: G(rnd <= 2) Let prop := (rnd <= 2); -- auxiliary condition Let at_inv := & for(i=0;i<=14;i=i+1) {at[i]= | for (j=1;j<=N;j=j+1) {(loc[j]=i)}}; Let aten_inv := & for(i=0;i<=14;i=i+1) {aten[i]= | for (j=1;j<=N;j=j+1) {(loc[j]=i & cnt[j]=1)}}; Let auxc := at_inv & aten_inv; -- Print "step 4: computing split invariant (universal, 2 vars) \n"; --split_invII prop,N,others_vars,auxc; -- Print "step 4: computing split invariant (universal, 1 vars) \n"; split_inv prop,N,others_vars,auxc; --Print "step 4: computing split invariant (existential, 1 var) \n"; --ex_split_inv prop,N,others_vars; Print "\nFinished!\n"; Chktime; -- show elapsed time Stats; End -- proc doit