-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SMG model export (.tra file) + regression tests.
- Loading branch information
1 parent
571a846
commit 44b16f9
Showing
10 changed files
with
120 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,36 @@ | ||
smg | ||
|
||
player p1 | ||
host, [send1], [send2] | ||
endplayer | ||
|
||
player p2 | ||
client | ||
endplayer | ||
|
||
module host | ||
h : [0..2] init 0; | ||
[send1] h=0 -> (h'=1); // send message 1 | ||
[send2] h=0 -> (h'=2); // send message 2 | ||
[] c=0 -> (h'=0); // restart | ||
endmodule | ||
|
||
module client | ||
c : [0..2] init 0; | ||
[send1] c=0 -> 0.85 : (c'=1) + 0.15 : (c'=0); // receive message 1 | ||
[send2] c=0 -> 0.85 : (c'=2) + 0.15 : (c'=0); // receive message 2 | ||
[] c!=0 -> (c'=0); // request another message | ||
[] c!=0 -> true; // wait | ||
endmodule | ||
|
||
label "two" = c=2; | ||
|
||
rewards "time" | ||
true : 1; | ||
endrewards | ||
|
||
rewards "sends" | ||
[send1] true : 1; | ||
[send2] true : 1; | ||
endrewards | ||
|
11 changes: 11 additions & 0 deletions
11
prism-tests/functionality/export/smg/smg_example.prism.exportmodel.auto
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,11 @@ | ||
# Export all model info | ||
|
||
-exportmodel smg_example.prism.all -ex | ||
|
||
# Export model info separately | ||
|
||
-exportmodel smg_example.prism.tra -ex | ||
-exportmodel smg_example.prism.sta -ex | ||
-exportmodel smg_example.prism.lab -ex | ||
-exportmodel smg_example.prism.srew -ex | ||
-exportmodel smg_example.prism.trew -ex |
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,3 @@ | ||
0="init" 1="deadlock" 2="two" | ||
0: 0 | ||
4: 2 |
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,6 @@ | ||
(h,c) | ||
0:(0,0) | ||
1:(1,0) | ||
2:(1,1) | ||
3:(2,0) | ||
4:(2,2) |
12 changes: 12 additions & 0 deletions
12
prism-tests/functionality/export/smg/smg_example.prism.tra
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,12 @@ | ||
5:2 9 11 | ||
0:0 0 0 1 | ||
0:0 1 1 0.15 send1 | ||
0:0 1 2 0.85 send1 | ||
0:0 2 3 0.15 send2 | ||
0:0 2 4 0.85 send2 | ||
1:0 0 0 1 | ||
2:1 0 1 1 | ||
2:1 1 2 1 | ||
3:0 0 0 1 | ||
4:1 0 3 1 | ||
4:1 1 4 1 |
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,8 @@ | ||
# Reward structure "time" | ||
# State rewards | ||
5 5 | ||
0 1 | ||
1 1 | ||
2 1 | ||
3 1 | ||
4 1 |
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,3 @@ | ||
# Reward structure "time" | ||
# Transition rewards | ||
5 9 0 |
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,3 @@ | ||
# Reward structure "sends" | ||
# State rewards | ||
5 0 |
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,7 @@ | ||
# Reward structure "sends" | ||
# Transition rewards | ||
5 9 4 | ||
0 1 1 1 | ||
0 1 2 1 | ||
0 2 3 1 | ||
0 2 4 1 |
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