The source code and dockerfile for the GSW2024 AI Lab.
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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
|
|
// sum of two dice as the asynchronous parallel composition of // two copies of Knuth's model of a fair die using only fair coins
mdp
//Coin Probabilities const double p1; const double p2;
module die1
// local state s1 : [0..7] init 0; // value of the dice d1 : [0..6] init 0;
[] s1=0 -> p1 : (s1'=1) + 1-p1 : (s1'=2); [] s1=1 -> p1 : (s1'=3) + 1-p1 : (s1'=4); [] s1=2 -> p1 : (s1'=5) + 1-p1 : (s1'=6); [] s1=3 -> p1 : (s1'=1) + 1-p1 : (s1'=7) & (d1'=1); [] s1=4 -> p1 : (s1'=7) & (d1'=2) + 1-p1 : (s1'=7) & (d1'=3); [] s1=5 -> p1 : (s1'=7) & (d1'=4) + 1-p1 : (s1'=7) & (d1'=5); [] s1=6 -> p1 : (s1'=2) + 1-p1 : (s1'=7) & (d1'=6); [] s1=7 & s2=7 -> 1: (s1'=7); endmodule
module die2 = die1 [ s1=s2, s2=s1, d1=d2, p1=p2 ] endmodule
rewards "coinflips" [] s1<7 | s2<7 : 1; endrewards
label "done" = s1=7 & s2=7; label "two" = s1=7 & s2=7 & d1+d2=2; label "three" = s1=7 & s2=7 & d1+d2=3; label "four" = s1=7 & s2=7 & d1+d2=4; label "five" = s1=7 & s2=7 & d1+d2=5; label "six" = s1=7 & s2=7 & d1+d2=6; label "seven" = s1=7 & s2=7 & d1+d2=7; label "eight" = s1=7 & s2=7 & d1+d2=8; label "nine" = s1=7 & s2=7 & d1+d2=9; label "ten" = s1=7 & s2=7 & d1+d2=10; label "eleven" = s1=7 & s2=7 & d1+d2=11; label "twelve" = s1=7 & s2=7 & d1+d2=12; label "doubles" = s1=7 & s2=7 & d1=d2;
|