|
|
@ -14,6 +14,7 @@ TEST(PrismParser, StandardModelTest) { |
|
|
|
EXPECT_NO_THROW(result = storm::parser::PrismParser::parse(STORM_TEST_RESOURCES_DIR "/dtmc/leader3_5.pm")); |
|
|
|
EXPECT_NO_THROW(result = storm::parser::PrismParser::parse(STORM_TEST_RESOURCES_DIR "/mdp/two_dice.nm")); |
|
|
|
EXPECT_NO_THROW(result = storm::parser::PrismParser::parse(STORM_TEST_RESOURCES_DIR "/mdp/wlan0_collide.nm")); |
|
|
|
EXPECT_NO_THROW(result = storm::parser::PrismParser::parse(STORM_TEST_RESOURCES_DIR "/smg/walker.nm")); |
|
|
|
} |
|
|
|
|
|
|
|
TEST(PrismParser, SimpleTest) { |
|
|
@ -100,6 +101,44 @@ TEST(PrismParser, ComplexTest) { |
|
|
|
EXPECT_EQ(2ul, result.getNumberOfRewardModels()); |
|
|
|
EXPECT_EQ(1ul, result.getNumberOfLabels()); |
|
|
|
EXPECT_FALSE(result.hasUnboundedVariables()); |
|
|
|
|
|
|
|
testInput = |
|
|
|
R"(smg |
|
|
|
|
|
|
|
player walker |
|
|
|
[a0], [a00], [a1], [a2], [a3] |
|
|
|
endplayer |
|
|
|
|
|
|
|
player blocker |
|
|
|
[a40], [a41] |
|
|
|
endplayer |
|
|
|
|
|
|
|
label "s0" = c=0 & b=0 & a=0; |
|
|
|
label "s1" = c=0 & b=0 & a=1; |
|
|
|
label "s2" = c=0 & b=1 & a=0; |
|
|
|
label "s3" = c=0 & b=1 & a=1; |
|
|
|
label "s4" = c=1 & b=0 & a=0; |
|
|
|
|
|
|
|
module transitions |
|
|
|
a : [0..1] init 0; |
|
|
|
b : [0..1] init 0; |
|
|
|
c : [0..1] init 0; |
|
|
|
|
|
|
|
[a0] a=0 & b=0 & c=0 -> 4/10 : (a'=1) + 6/10 : (b'=1); |
|
|
|
[a00] a=0 & b=0 & c=0 -> true; |
|
|
|
[a1] a=1 & b=0 & c=0 -> 3/10 : (a'=0) + 3/10 : (a'=0) & (b'=1) + 4/10 : (b'=1); |
|
|
|
[a2] a=0 & b=1 & c=0 -> 2/10 : (a'=1) + 8/10 : (b'=0) & (c'=1); |
|
|
|
[a3] a=1 & b=1 & c=0 -> true; |
|
|
|
[a40] a=0 & b=0 & c=1 -> 3/10 : (c'=0) + 7/10 : (a'=1) & (b'=1) & (c'=0); |
|
|
|
[a41] a=0 & b=0 & c=1 -> true; |
|
|
|
endmodule)"; |
|
|
|
|
|
|
|
EXPECT_NO_THROW(result = storm::parser::PrismParser::parseFromString(testInput, "testfile")); |
|
|
|
EXPECT_EQ(storm::prism::Program::ModelType::SMG, result.getModelType()); |
|
|
|
EXPECT_EQ(1ul, result.getNumberOfModules()); |
|
|
|
EXPECT_EQ(2ul, result.getNumberOfPlayers()); |
|
|
|
EXPECT_EQ(5ul, result.getNumberOfLabels()); |
|
|
|
>>>>>>> d7e3f7ed6 (added a smg to PrismParserTest.cpp) |
|
|
|
} |
|
|
|
|
|
|
|
TEST(PrismParser, UnboundedTest) { |
|
|
|