-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a test for the shortest trace functionality
Github: related to #131 "minimal trace mode"
- Loading branch information
Showing
1 changed file
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
-- checker_exit_code: 1 | ||
-- checker_output: None if xml else re.compile(r'^\s*invariant "path 1" failed', re.MULTILINE) | ||
|
||
/* This model is designed to provoke a longer-than-minimal error trace. If the | ||
* --shortest-trace option is functioning correctly, Rumur should correctly | ||
* suppress this longer trace and instead find the shorter but longer running | ||
* trace. | ||
*/ | ||
|
||
var | ||
x: 0 .. 100; | ||
z: 0 .. 100; | ||
w: 0 .. 100; | ||
path1: boolean; | ||
flag: boolean; | ||
path2: boolean; | ||
|
||
startstate begin | ||
x := 0; | ||
z := 0; | ||
w := 0; | ||
path1 := false; | ||
path2 := false; | ||
flag := false; | ||
end; | ||
|
||
rule x < 100 ==> begin | ||
x := x + 1; | ||
end; | ||
|
||
rule x > 0 ==> begin | ||
x := x - 1; | ||
end; | ||
|
||
rule z < 100 ==> begin | ||
z := z + 1; | ||
end; | ||
|
||
rule z > 0 ==> begin | ||
z := z - 1; | ||
end; | ||
|
||
rule w < 100 ==> begin | ||
w := w + 1; | ||
end; | ||
|
||
rule w > 0 ==> begin | ||
w := w - 1; | ||
end; | ||
|
||
rule z > 90 | w > 90 ==> begin | ||
flag := true; | ||
end; | ||
|
||
rule flag ==> begin | ||
path2 := true; | ||
end; | ||
|
||
rule x > 90 ==> begin | ||
for y: 0 .. 1000000 do | ||
x := x; | ||
end; | ||
path1 := true; | ||
end; | ||
|
||
invariant "path 1" !path1; | ||
invariant "path 2" !path2; |