diff --git a/haskell/Tests/RoundTrip.hs b/haskell/Tests/RoundTrip.hs index aa34117f..e6fb4917 100644 --- a/haskell/Tests/RoundTrip.hs +++ b/haskell/Tests/RoundTrip.hs @@ -247,17 +247,9 @@ testErlangRelations = test [ testRayleighRelations :: Test testRayleighRelations = test [ - "t_exponential_to_rayleigh" ~: testConcreteFiles "tests/RoundTrip2/t_exponential_to_rayleigh.0.hk" "tests/RoundTrip2/t_exponential_to_rayleigh.expected.hk" - ] - -testRayleighRelations :: Test -testRayleighRelations = test [ - "t_gamma_to_rayleigh" ~: testConcreteFiles "tests/RoundTrip2/t_gamma_to_rayleigh.0.hk" "tests/RoundTrip2/t_gamma_to_rayleigh.expected.hk" - ] - -testRayleighRelations :: Test -testRayleighRelations = test [ - "t_weibull_to_rayleigh" ~: testConcreteFiles "tests/RoundTrip2/t_weibull_to_rayleigh.0.hk" "tests/RoundTrip2/t_weibull_to_rayleigh.expected.hk" + "t_exponential_to_rayleigh" ~: testConcreteFiles "tests/RoundTrip/t_exponential_to_rayleigh.0.hk" "tests/RoundTrip/t_exponential_to_rayleigh.expected.hk", + "t_rayleigh_to_gamma" ~: testConcreteFiles "tests/RoundTrip/t_rayleigh_to_gamma.0.hk" "tests/RoundTrip/t_rayleigh_to_gamma.expected.hk", + "t_weibull_to_rayleigh" ~: testConcreteFiles "tests/RoundTrip/t_weibull_to_rayleigh.0.hk" "tests/RoundTrip/t_weibull_to_rayleigh.expected.hk" ] testOther :: Test diff --git a/tests/RoundTrip/t_exponential_to_rayleigh.0.hk b/tests/RoundTrip/t_exponential_to_rayleigh.0.hk new file mode 100644 index 00000000..bdebcaed --- /dev/null +++ b/tests/RoundTrip/t_exponential_to_rayleigh.0.hk @@ -0,0 +1,5 @@ +def exponential(alpha prob): + gamma(1/1,alpha) + +X <~ exponential(1) +return sqrt(X) \ No newline at end of file diff --git a/tests/RoundTrip/t_exponential_to_rayleigh.expected.hk b/tests/RoundTrip/t_exponential_to_rayleigh.expected.hk new file mode 100644 index 00000000..a8757033 --- /dev/null +++ b/tests/RoundTrip/t_exponential_to_rayleigh.expected.hk @@ -0,0 +1,3 @@ +#rayleigh(1) +X3 <~ uniform(+0/1, +1/1) +return sqrt(real2prob(log(real2prob(X3)) * (-1/1))) \ No newline at end of file diff --git a/tests/RoundTrip2/t_exponential_to_rayleigh.proof.mpl b/tests/RoundTrip/t_exponential_to_rayleigh.proof.mpl similarity index 100% rename from tests/RoundTrip2/t_exponential_to_rayleigh.proof.mpl rename to tests/RoundTrip/t_exponential_to_rayleigh.proof.mpl diff --git a/tests/RoundTrip2/t_gamma_to_rayleigh.expected.hk b/tests/RoundTrip/t_rayleigh_to_gamma.0.hk similarity index 100% rename from tests/RoundTrip2/t_gamma_to_rayleigh.expected.hk rename to tests/RoundTrip/t_rayleigh_to_gamma.0.hk diff --git a/tests/RoundTrip/t_rayleigh_to_gamma.expected.hk b/tests/RoundTrip/t_rayleigh_to_gamma.expected.hk new file mode 100644 index 00000000..d9074f12 --- /dev/null +++ b/tests/RoundTrip/t_rayleigh_to_gamma.expected.hk @@ -0,0 +1 @@ +gamma(1/1,2/1) \ No newline at end of file diff --git a/tests/RoundTrip2/t_gamma_to_rayleigh.proof.mpl b/tests/RoundTrip/t_rayleigh_to_gamma.proof.mpl similarity index 100% rename from tests/RoundTrip2/t_gamma_to_rayleigh.proof.mpl rename to tests/RoundTrip/t_rayleigh_to_gamma.proof.mpl diff --git a/tests/RoundTrip2/t_weibull_to_rayleigh.0.hk b/tests/RoundTrip/t_weibull_to_rayleigh.0.hk similarity index 100% rename from tests/RoundTrip2/t_weibull_to_rayleigh.0.hk rename to tests/RoundTrip/t_weibull_to_rayleigh.0.hk diff --git a/tests/RoundTrip/t_weibull_to_rayleigh.expected.hk b/tests/RoundTrip/t_weibull_to_rayleigh.expected.hk new file mode 100644 index 00000000..b17311c2 --- /dev/null +++ b/tests/RoundTrip/t_weibull_to_rayleigh.expected.hk @@ -0,0 +1,3 @@ +#rayleigh(1) +X <~ uniform(+0/1, +1/1) +return sqrt(real2prob(log(real2prob(X)) * (-1/1))) \ No newline at end of file diff --git a/tests/RoundTrip2/t_weibull_to_rayleigh.proof.mpl b/tests/RoundTrip/t_weibull_to_rayleigh.proof.mpl similarity index 100% rename from tests/RoundTrip2/t_weibull_to_rayleigh.proof.mpl rename to tests/RoundTrip/t_weibull_to_rayleigh.proof.mpl diff --git a/tests/RoundTrip2/t_exponential_to_rayleigh.0.hk b/tests/RoundTrip2/t_exponential_to_rayleigh.0.hk deleted file mode 100644 index a2225e48..00000000 --- a/tests/RoundTrip2/t_exponential_to_rayleigh.0.hk +++ /dev/null @@ -1,6 +0,0 @@ -def exponential(alpha prob): - X <~ uniform(0,1) - return -1 * alpha * log(real2prob(X)) - -X <~ exponential(1) -return sqrt(real2prob(X)) \ No newline at end of file diff --git a/tests/RoundTrip2/t_exponential_to_rayleigh.expected.hk b/tests/RoundTrip2/t_exponential_to_rayleigh.expected.hk deleted file mode 100644 index 41058c9d..00000000 --- a/tests/RoundTrip2/t_exponential_to_rayleigh.expected.hk +++ /dev/null @@ -1,9 +0,0 @@ -def exponential(alpha prob): - X <~ uniform(0,1) - return -1 * alpha * log(real2prob(X)) - -def rayleigh(alpha prob): - X <~ exponential(alpha) - return sqrt(real2prob(X)) - -rayleigh(1) \ No newline at end of file diff --git a/tests/RoundTrip2/t_gamma_to_rayleigh.0.hk b/tests/RoundTrip2/t_gamma_to_rayleigh.0.hk deleted file mode 100644 index 39c3e45b..00000000 --- a/tests/RoundTrip2/t_gamma_to_rayleigh.0.hk +++ /dev/null @@ -1 +0,0 @@ -gamma(1,2) \ No newline at end of file diff --git a/tests/RoundTrip2/t_weibull_to_rayleigh.expected.hk b/tests/RoundTrip2/t_weibull_to_rayleigh.expected.hk deleted file mode 100644 index 41058c9d..00000000 --- a/tests/RoundTrip2/t_weibull_to_rayleigh.expected.hk +++ /dev/null @@ -1,9 +0,0 @@ -def exponential(alpha prob): - X <~ uniform(0,1) - return -1 * alpha * log(real2prob(X)) - -def rayleigh(alpha prob): - X <~ exponential(alpha) - return sqrt(real2prob(X)) - -rayleigh(1) \ No newline at end of file