From 06bc2d726e80c73cc1331e575c155b5546078153 Mon Sep 17 00:00:00 2001 From: Mahmoud Khattab Date: Tue, 24 Apr 2018 02:31:02 -0400 Subject: [PATCH 1/2] Remove duplicate --- haskell/Tests/RoundTrip.hs | 1 - 1 file changed, 1 deletion(-) diff --git a/haskell/Tests/RoundTrip.hs b/haskell/Tests/RoundTrip.hs index aa34117f..9fe133f7 100644 --- a/haskell/Tests/RoundTrip.hs +++ b/haskell/Tests/RoundTrip.hs @@ -306,7 +306,6 @@ allTests = test , testCauchyRelations , testExponentialRelations , testRayleighRelations - , testCauchyRelations , testOther ] From a359c4632fc8577ee9adf766c0c9aff45631b73c Mon Sep 17 00:00:00 2001 From: Mahmoud Khattab Date: Tue, 24 Apr 2018 02:51:36 -0400 Subject: [PATCH 2/2] Inlined them --- haskell/Tests/RoundTrip.hs | 4 ++-- .../t_cauchy_add_transformation.0.hk | 0 .../t_cauchy_add_transformation.expected.hk | 4 ++++ .../t_cauchy_sub_transformation.0.hk | 0 .../t_cauchy_sub_transformation.expected.hk | 4 ++++ .../t_cauchy_add_transformation.expected.hk | 15 --------------- .../t_cauchy_sub_transformation.expected.hk | 15 --------------- 7 files changed, 10 insertions(+), 32 deletions(-) rename tests/{RoundTrip2 => RoundTrip}/t_cauchy_add_transformation.0.hk (100%) create mode 100644 tests/RoundTrip/t_cauchy_add_transformation.expected.hk rename tests/{RoundTrip2 => RoundTrip}/t_cauchy_sub_transformation.0.hk (100%) create mode 100644 tests/RoundTrip/t_cauchy_sub_transformation.expected.hk delete mode 100644 tests/RoundTrip2/t_cauchy_add_transformation.expected.hk delete mode 100644 tests/RoundTrip2/t_cauchy_sub_transformation.expected.hk diff --git a/haskell/Tests/RoundTrip.hs b/haskell/Tests/RoundTrip.hs index 9fe133f7..8abecd4b 100644 --- a/haskell/Tests/RoundTrip.hs +++ b/haskell/Tests/RoundTrip.hs @@ -217,8 +217,8 @@ testStdChiSqRelations = test [ testCauchyRelations :: Test testCauchyRelations = test [ - "t_cauchy_add_transformation" ~: testConcreteFiles "tests/RoundTrip2/t_cauchy_add_transformation.0.hk" "tests/RoundTrip2/t_cauchy_add_transformation.expected.hk", - "t_cauchy_sub_transformation" ~: testConcreteFiles "tests/RoundTrip2/t_cauchy_sub_transformation.0.hk" "tests/RoundTrip2/t_cauchy_sub_transformation.expected.hk" + "t_cauchy_add_transformation" ~: testConcreteFiles "tests/RoundTrip/t_cauchy_add_transformation.0.hk" "tests/RoundTrip/t_cauchy_add_transformation.expected.hk", + "t_cauchy_sub_transformation" ~: testConcreteFiles "tests/RoundTrip/t_cauchy_sub_transformation.0.hk" "tests/RoundTrip/t_cauchy_sub_transformation.expected.hk" ] testExponentialRelations :: Test diff --git a/tests/RoundTrip2/t_cauchy_add_transformation.0.hk b/tests/RoundTrip/t_cauchy_add_transformation.0.hk similarity index 100% rename from tests/RoundTrip2/t_cauchy_add_transformation.0.hk rename to tests/RoundTrip/t_cauchy_add_transformation.0.hk diff --git a/tests/RoundTrip/t_cauchy_add_transformation.expected.hk b/tests/RoundTrip/t_cauchy_add_transformation.expected.hk new file mode 100644 index 00000000..19b38c4b --- /dev/null +++ b/tests/RoundTrip/t_cauchy_add_transformation.expected.hk @@ -0,0 +1,4 @@ +# cauchy(4, 6) +X1 <~ normal(+0/1, 1/1) +X2 <~ normal(+0/1, 1/1) +return (X2 * (+2/1) + X1 * (+3/1)) / X2 * (+2/1) \ No newline at end of file diff --git a/tests/RoundTrip2/t_cauchy_sub_transformation.0.hk b/tests/RoundTrip/t_cauchy_sub_transformation.0.hk similarity index 100% rename from tests/RoundTrip2/t_cauchy_sub_transformation.0.hk rename to tests/RoundTrip/t_cauchy_sub_transformation.0.hk diff --git a/tests/RoundTrip/t_cauchy_sub_transformation.expected.hk b/tests/RoundTrip/t_cauchy_sub_transformation.expected.hk new file mode 100644 index 00000000..080ee12d --- /dev/null +++ b/tests/RoundTrip/t_cauchy_sub_transformation.expected.hk @@ -0,0 +1,4 @@ +# cauchy(-2, 6) +X1 <~ normal(+0/1, 1/1) +X2 <~ normal(+0/1, 1/1) +return (X2 * (-1/1) + X1 * (+3/1)) / X2 * (+2/1) \ No newline at end of file diff --git a/tests/RoundTrip2/t_cauchy_add_transformation.expected.hk b/tests/RoundTrip2/t_cauchy_add_transformation.expected.hk deleted file mode 100644 index c6654445..00000000 --- a/tests/RoundTrip2/t_cauchy_add_transformation.expected.hk +++ /dev/null @@ -1,15 +0,0 @@ -def stdNormal(): - p <~ normal(0, 1) - return p - -def stdCauchy(): - X1 <~ stdNormal() - X2 <~ stdNormal() - return X1/X2 - -def cauchy(a real, alpha prob): - X <~ stdCauchy() - return a + alpha*X - -X <~ cauchy(4, 6) -return X \ No newline at end of file diff --git a/tests/RoundTrip2/t_cauchy_sub_transformation.expected.hk b/tests/RoundTrip2/t_cauchy_sub_transformation.expected.hk deleted file mode 100644 index ab4b87e1..00000000 --- a/tests/RoundTrip2/t_cauchy_sub_transformation.expected.hk +++ /dev/null @@ -1,15 +0,0 @@ -def stdNormal(): - p <~ normal(0, 1) - return p - -def stdCauchy(): - X1 <~ stdNormal() - X2 <~ stdNormal() - return X1/X2 - -def cauchy(a real, alpha prob): - X <~ stdCauchy() - return a + alpha*X - -X <~ cauchy(-2, 6) -return X \ No newline at end of file