-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the code generation error for static functions called from Monito…
…rs (#530) * Fixing the problem around allowing functions with side effects inside a monitor * Added more regressions for the static function in monitors * Fixed the regression that was failing
- Loading branch information
1 parent
007ab2f
commit 88ab781
Showing
13 changed files
with
169 additions
and
33 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
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
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
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
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
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
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
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
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
26 changes: 26 additions & 0 deletions
26
...Tests/Feature1SMLevelDecls/DynamicError/StaticFunctionInMonitor/StaticFunctionInMonitor.p
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,26 @@ | ||
fun foo() { | ||
var x: machine; | ||
assert false; | ||
} | ||
|
||
event e1; | ||
|
||
spec M observes e1 { | ||
|
||
start state Init { | ||
entry { | ||
foo(); | ||
} | ||
|
||
} | ||
} | ||
|
||
machine Main { | ||
start state Init { | ||
entry { | ||
send this, e1; | ||
} | ||
} | ||
} | ||
|
||
test DefaultImpl [main=Main]: assert M in {Main}; |
15 changes: 15 additions & 0 deletions
15
Tst/RegressionTests/Feature1SMLevelDecls/StaticError/SendInMonitor/SendInMonitor.p
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,15 @@ | ||
event e1; | ||
|
||
spec Main observes e1 { | ||
|
||
fun foo(x: machine) { | ||
send x, e1; | ||
} | ||
|
||
start state Init { | ||
entry { | ||
var x: machine; | ||
send x, e1; | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...ressionTests/Feature1SMLevelDecls/StaticError/SideEffectsInMonitor/SideEffectsInMonitor.p
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,23 @@ | ||
event e1; | ||
|
||
spec M observes e1 { | ||
start state Init { | ||
|
||
} | ||
|
||
fun foo(x: machine) { | ||
send x, e1; | ||
|
||
receive { | ||
case e1: {} | ||
} | ||
|
||
new Main(); | ||
} | ||
} | ||
|
||
machine Main { | ||
start state Init { | ||
|
||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...nTests/Feature1SMLevelDecls/StaticError/StaticFunctionInMonitor/StaticFunctionInMonitor.p
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,26 @@ | ||
fun foo() { | ||
var x: machine; | ||
send x, e1; | ||
} | ||
|
||
event e1; | ||
|
||
spec M observes e1 { | ||
|
||
start state Init { | ||
entry { | ||
foo(); | ||
} | ||
|
||
} | ||
} | ||
|
||
machine Main { | ||
start state Init { | ||
entry { | ||
foo(); | ||
} | ||
} | ||
} | ||
|
||
test X [main=Main]: assert M in {Main}; |