You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
700 B

  1. dtmc
  2. module die
  3. // local state
  4. s : [0..7] init 0;
  5. // value of the die
  6. d : [0..6] init 0;
  7. [] s=0 -> 0.5 : (s'=1) + 0.5 : (s'=2);
  8. [] s=1 -> 0.5 : (s'=3) + 0.5 : (s'=4);
  9. [] s=2 -> 0.5 : (s'=5) + 0.5 : (s'=6);
  10. [] s=3 -> 0.5 : (s'=1) + 0.5 : (s'=7) & (d'=1);
  11. [] s=4 -> 0.5 : (s'=7) & (d'=2) + 0.5 : (s'=7) & (d'=3);
  12. [] s=5 -> 0.5 : (s'=7) & (d'=4) + 0.5 : (s'=7) & (d'=5);
  13. [] s=6 -> 0.5 : (s'=2) + 0.5 : (s'=7) & (d'=6);
  14. [] s=7 -> (s'=7);
  15. endmodule
  16. rewards "coin_flips"
  17. [] s<7 : 1;
  18. endrewards
  19. label "one" = s=7&d=1;
  20. label "two" = s=7&d=2;
  21. label "three" = s=7&d=3;
  22. label "four" = s=7&d=4;
  23. label "five" = s=7&d=5;
  24. label "six" = s=7&d=6;
  25. label "done" = s=7;