diff --git a/plutus-benchmark/marlowe/test/semantics/0000020002010200020101020201000100010001020101020201010000020102.eval.golden b/plutus-benchmark/marlowe/test/semantics/0000020002010200020101020201000100010001020101020201010000020102.eval.golden index c67b57a1d83..ce873b921b3 100644 --- a/plutus-benchmark/marlowe/test/semantics/0000020002010200020101020201000100010001020101020201010000020102.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/0000020002010200020101020201000100010001020101020201010000020102.eval.golden @@ -1,2 +1,2 @@ -({cpu: 687122394 -| mem: 2212763}) \ No newline at end of file +({cpu: 684546394 +| mem: 2201563}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/0001000101000000010101000001000001010101010100000001000001010000.eval.golden b/plutus-benchmark/marlowe/test/semantics/0001000101000000010101000001000001010101010100000001000001010000.eval.golden index a8039474d6d..b62045f6955 100644 --- a/plutus-benchmark/marlowe/test/semantics/0001000101000000010101000001000001010101010100000001000001010000.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/0001000101000000010101000001000001010101010100000001000001010000.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1251880556 -| mem: 4111036}) \ No newline at end of file +({cpu: 1248384556 +| mem: 4095836}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/0003040402030103010203030303000200000104030002040304020400000102.eval.golden b/plutus-benchmark/marlowe/test/semantics/0003040402030103010203030303000200000104030002040304020400000102.eval.golden index 93928ce2625..a254828be0f 100644 --- a/plutus-benchmark/marlowe/test/semantics/0003040402030103010203030303000200000104030002040304020400000102.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/0003040402030103010203030303000200000104030002040304020400000102.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1485672955 -| mem: 5685572}) \ No newline at end of file +({cpu: 1475736955 +| mem: 5642372}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/004025fd712d6c325ffa12c16d157064192992faf62e0b991d7310a2f91666b8.eval.golden b/plutus-benchmark/marlowe/test/semantics/004025fd712d6c325ffa12c16d157064192992faf62e0b991d7310a2f91666b8.eval.golden index 76b52b02339..987961beb0f 100644 --- a/plutus-benchmark/marlowe/test/semantics/004025fd712d6c325ffa12c16d157064192992faf62e0b991d7310a2f91666b8.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/004025fd712d6c325ffa12c16d157064192992faf62e0b991d7310a2f91666b8.eval.golden @@ -1,2 +1,2 @@ -({cpu: 2477299815 -| mem: 8103779}) \ No newline at end of file +({cpu: 2471411815 +| mem: 8078179}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/0101010001010101010101000100010100000001010000010001000001000101.eval.golden b/plutus-benchmark/marlowe/test/semantics/0101010001010101010101000100010100000001010000010001000001000101.eval.golden index 20ddcbfc8a7..02e1d50c458 100644 --- a/plutus-benchmark/marlowe/test/semantics/0101010001010101010101000100010100000001010000010001000001000101.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/0101010001010101010101000100010100000001010000010001000001000101.eval.golden @@ -1,2 +1,2 @@ -({cpu: 8460820933 -| mem: 24327740}) \ No newline at end of file +({cpu: 8454932933 +| mem: 24302140}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/0101020201010201010200010102000201000201010102000102010201010000.eval.golden b/plutus-benchmark/marlowe/test/semantics/0101020201010201010200010102000201000201010102000102010201010000.eval.golden index e50714d1e09..31e0eab0999 100644 --- a/plutus-benchmark/marlowe/test/semantics/0101020201010201010200010102000201000201010102000102010201010000.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/0101020201010201010200010102000201000201010102000102010201010000.eval.golden @@ -1,2 +1,2 @@ -({cpu: 518082880 -| mem: 1752969}) \ No newline at end of file +({cpu: 515690880 +| mem: 1742569}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/0101080808040600020306010000000302050807010208060100070207080202.eval.golden b/plutus-benchmark/marlowe/test/semantics/0101080808040600020306010000000302050807010208060100070207080202.eval.golden index 00486359e4a..ce1c8b1c834 100644 --- a/plutus-benchmark/marlowe/test/semantics/0101080808040600020306010000000302050807010208060100070207080202.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/0101080808040600020306010000000302050807010208060100070207080202.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1556965057 -| mem: 5477264}) \ No newline at end of file +({cpu: 1550341057 +| mem: 5448464}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/0104010200020000040103020102020004040300030304040400010301040303.eval.golden b/plutus-benchmark/marlowe/test/semantics/0104010200020000040103020102020004040300030304040400010301040303.eval.golden index eaf59ec6b06..04678fd826f 100644 --- a/plutus-benchmark/marlowe/test/semantics/0104010200020000040103020102020004040300030304040400010301040303.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/0104010200020000040103020102020004040300030304040400010301040303.eval.golden @@ -1,2 +1,2 @@ -({cpu: 846592504 -| mem: 3216335}) \ No newline at end of file +({cpu: 841256504 +| mem: 3193135}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/04000f0b04051006000e060f09080d0b090d0104050a0b0f0506070f0a070008.eval.golden b/plutus-benchmark/marlowe/test/semantics/04000f0b04051006000e060f09080d0b090d0104050a0b0f0506070f0a070008.eval.golden index df506154edd..96c0e08bcec 100644 --- a/plutus-benchmark/marlowe/test/semantics/04000f0b04051006000e060f09080d0b090d0104050a0b0f0506070f0a070008.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/04000f0b04051006000e060f09080d0b090d0104050a0b0f0506070f0a070008.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1493107324 -| mem: 5132473}) \ No newline at end of file +({cpu: 1486667324 +| mem: 5104473}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/0543a00ba1f63076c1db6bf94c6ff13ae7d266dd7544678743890b0e8e1add63.eval.golden b/plutus-benchmark/marlowe/test/semantics/0543a00ba1f63076c1db6bf94c6ff13ae7d266dd7544678743890b0e8e1add63.eval.golden index 6e492032463..afee8c3c69f 100644 --- a/plutus-benchmark/marlowe/test/semantics/0543a00ba1f63076c1db6bf94c6ff13ae7d266dd7544678743890b0e8e1add63.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/0543a00ba1f63076c1db6bf94c6ff13ae7d266dd7544678743890b0e8e1add63.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1091216220 -| mem: 3878291}) \ No newline at end of file +({cpu: 1081648220 +| mem: 3836691}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/0705030002040601010206030604080208020207000101060706050502040301.eval.golden b/plutus-benchmark/marlowe/test/semantics/0705030002040601010206030604080208020207000101060706050502040301.eval.golden index c0692f21bca..a1990114062 100644 --- a/plutus-benchmark/marlowe/test/semantics/0705030002040601010206030604080208020207000101060706050502040301.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/0705030002040601010206030604080208020207000101060706050502040301.eval.golden @@ -1,2 +1,2 @@ -({cpu: 2427636502 -| mem: 7750814}) \ No newline at end of file +({cpu: 2420276502 +| mem: 7718814}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/07070c070510030509010e050d00040907050e0a0d06030f1006030701020607.eval.golden b/plutus-benchmark/marlowe/test/semantics/07070c070510030509010e050d00040907050e0a0d06030f1006030701020607.eval.golden index 3c171eef9ec..9df14820ac8 100644 --- a/plutus-benchmark/marlowe/test/semantics/07070c070510030509010e050d00040907050e0a0d06030f1006030701020607.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/07070c070510030509010e050d00040907050e0a0d06030f1006030701020607.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1223872565 -| mem: 4605293}) \ No newline at end of file +({cpu: 1213016565 +| mem: 4558093}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/0bcfd9487614104ec48de2ea0b2c0979866a95115748c026f9ec129384c262c4.eval.golden b/plutus-benchmark/marlowe/test/semantics/0bcfd9487614104ec48de2ea0b2c0979866a95115748c026f9ec129384c262c4.eval.golden index 3f31e495b02..88827d47575 100644 --- a/plutus-benchmark/marlowe/test/semantics/0bcfd9487614104ec48de2ea0b2c0979866a95115748c026f9ec129384c262c4.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/0bcfd9487614104ec48de2ea0b2c0979866a95115748c026f9ec129384c262c4.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1253172275 -| mem: 4764911}) \ No newline at end of file +({cpu: 1242684275 +| mem: 4719311}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/0be82588e4e4bf2ef428d2f44b7687bbb703031d8de696d90ec789e70d6bc1d8.eval.golden b/plutus-benchmark/marlowe/test/semantics/0be82588e4e4bf2ef428d2f44b7687bbb703031d8de696d90ec789e70d6bc1d8.eval.golden index 87e67ad570b..e155548d4fd 100644 --- a/plutus-benchmark/marlowe/test/semantics/0be82588e4e4bf2ef428d2f44b7687bbb703031d8de696d90ec789e70d6bc1d8.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/0be82588e4e4bf2ef428d2f44b7687bbb703031d8de696d90ec789e70d6bc1d8.eval.golden @@ -1,2 +1,2 @@ -({cpu: 2011286646 -| mem: 7368534}) \ No newline at end of file +({cpu: 1998958646 +| mem: 7314934}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/0f1d0110001b121d051e15140c0c05141d151c1f1d201c040f10091b020a0e1a.eval.golden b/plutus-benchmark/marlowe/test/semantics/0f1d0110001b121d051e15140c0c05141d151c1f1d201c040f10091b020a0e1a.eval.golden index 3fbe504b170..63b9f20a9b6 100644 --- a/plutus-benchmark/marlowe/test/semantics/0f1d0110001b121d051e15140c0c05141d151c1f1d201c040f10091b020a0e1a.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/0f1d0110001b121d051e15140c0c05141d151c1f1d201c040f10091b020a0e1a.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1033967537 -| mem: 3406103}) \ No newline at end of file +({cpu: 1030103537 +| mem: 3389303}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/119fbea4164e2bf21d2b53aa6c2c4e79414fe55e4096f5ce2e804735a7fbaf91.eval.golden b/plutus-benchmark/marlowe/test/semantics/119fbea4164e2bf21d2b53aa6c2c4e79414fe55e4096f5ce2e804735a7fbaf91.eval.golden index bcccbb6fd91..1ecd1b96337 100644 --- a/plutus-benchmark/marlowe/test/semantics/119fbea4164e2bf21d2b53aa6c2c4e79414fe55e4096f5ce2e804735a7fbaf91.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/119fbea4164e2bf21d2b53aa6c2c4e79414fe55e4096f5ce2e804735a7fbaf91.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1112687136 -| mem: 3991697}) \ No newline at end of file +({cpu: 1107167136 +| mem: 3967697}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/12910f24d994d451ff379b12c9d1ecdb9239c9b87e5d7bea570087ec506935d5.eval.golden b/plutus-benchmark/marlowe/test/semantics/12910f24d994d451ff379b12c9d1ecdb9239c9b87e5d7bea570087ec506935d5.eval.golden index e38e1ee7a87..598f586337c 100644 --- a/plutus-benchmark/marlowe/test/semantics/12910f24d994d451ff379b12c9d1ecdb9239c9b87e5d7bea570087ec506935d5.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/12910f24d994d451ff379b12c9d1ecdb9239c9b87e5d7bea570087ec506935d5.eval.golden @@ -1,2 +1,2 @@ -({cpu: 693769400 -| mem: 2498127}) \ No newline at end of file +({cpu: 690273400 +| mem: 2482927}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/18cefc240debc0fcab14efdd451adfd02793093efe7bc76d6322aed6ddb582ad.eval.golden b/plutus-benchmark/marlowe/test/semantics/18cefc240debc0fcab14efdd451adfd02793093efe7bc76d6322aed6ddb582ad.eval.golden index 13390d3550a..27cca85fa5f 100644 --- a/plutus-benchmark/marlowe/test/semantics/18cefc240debc0fcab14efdd451adfd02793093efe7bc76d6322aed6ddb582ad.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/18cefc240debc0fcab14efdd451adfd02793093efe7bc76d6322aed6ddb582ad.eval.golden @@ -1,2 +1,2 @@ -({cpu: 905798501 -| mem: 3358297}) \ No newline at end of file +({cpu: 898806501 +| mem: 3327897}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/1a2f2540121f09321216090b2b1f211e3f020c2c133a1a3c3f3c232a26153a04.eval.golden b/plutus-benchmark/marlowe/test/semantics/1a2f2540121f09321216090b2b1f211e3f020c2c133a1a3c3f3c232a26153a04.eval.golden index 729cc9c2abb..7916ec02275 100644 --- a/plutus-benchmark/marlowe/test/semantics/1a2f2540121f09321216090b2b1f211e3f020c2c133a1a3c3f3c232a26153a04.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/1a2f2540121f09321216090b2b1f211e3f020c2c133a1a3c3f3c232a26153a04.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1738274866 -| mem: 5207809}) \ No newline at end of file +({cpu: 1735698866 +| mem: 5196609}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/1a573aed5c46d637919ccb5548dfc22a55c9fc38298d567d15ee9f2eea69d89e.eval.golden b/plutus-benchmark/marlowe/test/semantics/1a573aed5c46d637919ccb5548dfc22a55c9fc38298d567d15ee9f2eea69d89e.eval.golden index b452343af7a..8649ed23485 100644 --- a/plutus-benchmark/marlowe/test/semantics/1a573aed5c46d637919ccb5548dfc22a55c9fc38298d567d15ee9f2eea69d89e.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/1a573aed5c46d637919ccb5548dfc22a55c9fc38298d567d15ee9f2eea69d89e.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1639479702 -| mem: 5827678}) \ No newline at end of file +({cpu: 1633775702 +| mem: 5802878}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/1d56060c3b271226064c672a282663643b1b0823471c67737f0b076870331260.eval.golden b/plutus-benchmark/marlowe/test/semantics/1d56060c3b271226064c672a282663643b1b0823471c67737f0b076870331260.eval.golden index b3443f884a3..4ad87261e92 100644 --- a/plutus-benchmark/marlowe/test/semantics/1d56060c3b271226064c672a282663643b1b0823471c67737f0b076870331260.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/1d56060c3b271226064c672a282663643b1b0823471c67737f0b076870331260.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1507656996 -| mem: 5126683}) \ No newline at end of file +({cpu: 1501952996 +| mem: 5101883}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/1d6e3c137149a440f35e0efc685b16bfb8052ebcf66ec4ad77e51c11501381c7.eval.golden b/plutus-benchmark/marlowe/test/semantics/1d6e3c137149a440f35e0efc685b16bfb8052ebcf66ec4ad77e51c11501381c7.eval.golden index faa19a47695..a9ca19c0678 100644 --- a/plutus-benchmark/marlowe/test/semantics/1d6e3c137149a440f35e0efc685b16bfb8052ebcf66ec4ad77e51c11501381c7.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/1d6e3c137149a440f35e0efc685b16bfb8052ebcf66ec4ad77e51c11501381c7.eval.golden @@ -1,2 +1,2 @@ -({cpu: 591465754 -| mem: 1960983}) \ No newline at end of file +({cpu: 588889754 +| mem: 1949783}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/1f0f02191604101e1f201016171604060d010d1d1c150e110a110e1006160a0d.eval.golden b/plutus-benchmark/marlowe/test/semantics/1f0f02191604101e1f201016171604060d010d1d1c150e110a110e1006160a0d.eval.golden index 827a6f323d3..3ee8c7dad7a 100644 --- a/plutus-benchmark/marlowe/test/semantics/1f0f02191604101e1f201016171604060d010d1d1c150e110a110e1006160a0d.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/1f0f02191604101e1f201016171604060d010d1d1c150e110a110e1006160a0d.eval.golden @@ -1,2 +1,2 @@ -({cpu: 35971444004 -| mem: 99163620}) \ No newline at end of file +({cpu: 35968684004 +| mem: 99151620}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/202d273721330b31193405101e0637202e2a0f1140211c3e3f171e26312b0220.eval.golden b/plutus-benchmark/marlowe/test/semantics/202d273721330b31193405101e0637202e2a0f1140211c3e3f171e26312b0220.eval.golden index 20f4fc33c5f..09d7bbf2ee6 100644 --- a/plutus-benchmark/marlowe/test/semantics/202d273721330b31193405101e0637202e2a0f1140211c3e3f171e26312b0220.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/202d273721330b31193405101e0637202e2a0f1140211c3e3f171e26312b0220.eval.golden @@ -1,2 +1,2 @@ -({cpu: 192061552781 -| mem: 541519822}) \ No newline at end of file +({cpu: 192057688781 +| mem: 541503022}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/21953bf8798b28df60cb459db24843fb46782b19ba72dc4951941fb4c20d2263.eval.golden b/plutus-benchmark/marlowe/test/semantics/21953bf8798b28df60cb459db24843fb46782b19ba72dc4951941fb4c20d2263.eval.golden index a56a871bc32..836e825d86c 100644 --- a/plutus-benchmark/marlowe/test/semantics/21953bf8798b28df60cb459db24843fb46782b19ba72dc4951941fb4c20d2263.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/21953bf8798b28df60cb459db24843fb46782b19ba72dc4951941fb4c20d2263.eval.golden @@ -1,2 +1,2 @@ -({cpu: 831208925 -| mem: 2872500}) \ No newline at end of file +({cpu: 828264925 +| mem: 2859700}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/238b21364ab5bdae3ddb514d7001c8feba128b4ddcf426852b441f9a9d02c882.eval.golden b/plutus-benchmark/marlowe/test/semantics/238b21364ab5bdae3ddb514d7001c8feba128b4ddcf426852b441f9a9d02c882.eval.golden index 72d70effabf..907281a462a 100644 --- a/plutus-benchmark/marlowe/test/semantics/238b21364ab5bdae3ddb514d7001c8feba128b4ddcf426852b441f9a9d02c882.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/238b21364ab5bdae3ddb514d7001c8feba128b4ddcf426852b441f9a9d02c882.eval.golden @@ -1,2 +1,2 @@ -({cpu: 518980528 -| mem: 1782167}) \ No newline at end of file +({cpu: 516588528 +| mem: 1771767}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/26e24ee631a6d927ea4fb4fac530cfd82ff7636986014de2d2aaa460ddde0bc3.eval.golden b/plutus-benchmark/marlowe/test/semantics/26e24ee631a6d927ea4fb4fac530cfd82ff7636986014de2d2aaa460ddde0bc3.eval.golden index 5639b4a1348..82904d63df0 100644 --- a/plutus-benchmark/marlowe/test/semantics/26e24ee631a6d927ea4fb4fac530cfd82ff7636986014de2d2aaa460ddde0bc3.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/26e24ee631a6d927ea4fb4fac530cfd82ff7636986014de2d2aaa460ddde0bc3.eval.golden @@ -1,2 +1,2 @@ -({cpu: 762779000 -| mem: 2887394}) \ No newline at end of file +({cpu: 757259000 +| mem: 2863394}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/2797d7ac77c1b6aff8e42cf9a47fa86b1e60f22719a996871ad412cbe4de78b5.eval.golden b/plutus-benchmark/marlowe/test/semantics/2797d7ac77c1b6aff8e42cf9a47fa86b1e60f22719a996871ad412cbe4de78b5.eval.golden index 75b7c9ae2ad..414b4739d14 100644 --- a/plutus-benchmark/marlowe/test/semantics/2797d7ac77c1b6aff8e42cf9a47fa86b1e60f22719a996871ad412cbe4de78b5.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/2797d7ac77c1b6aff8e42cf9a47fa86b1e60f22719a996871ad412cbe4de78b5.eval.golden @@ -1,2 +1,2 @@ -({cpu: 38987610944 -| mem: 109300782}) \ No newline at end of file +({cpu: 38983930944 +| mem: 109284782}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/28fdce478e179db0e38fb5f3f4105e940ece450b9ce8a0f42a6e313b752e6f2c.eval.golden b/plutus-benchmark/marlowe/test/semantics/28fdce478e179db0e38fb5f3f4105e940ece450b9ce8a0f42a6e313b752e6f2c.eval.golden index 80de7db5e05..da686e29678 100644 --- a/plutus-benchmark/marlowe/test/semantics/28fdce478e179db0e38fb5f3f4105e940ece450b9ce8a0f42a6e313b752e6f2c.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/28fdce478e179db0e38fb5f3f4105e940ece450b9ce8a0f42a6e313b752e6f2c.eval.golden @@ -1,2 +1,2 @@ -({cpu: 4584392073 -| mem: 13600344}) \ No newline at end of file +({cpu: 4577400073 +| mem: 13569944}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/2cb21612178a2d9336b59d06cbf80488577463d209a453048a66c6eee624a695.eval.golden b/plutus-benchmark/marlowe/test/semantics/2cb21612178a2d9336b59d06cbf80488577463d209a453048a66c6eee624a695.eval.golden index 4f626a8c6a7..9c7bc1ff3a2 100644 --- a/plutus-benchmark/marlowe/test/semantics/2cb21612178a2d9336b59d06cbf80488577463d209a453048a66c6eee624a695.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/2cb21612178a2d9336b59d06cbf80488577463d209a453048a66c6eee624a695.eval.golden @@ -1,2 +1,2 @@ -({cpu: 859654175 -| mem: 3262733}) \ No newline at end of file +({cpu: 853030175 +| mem: 3233933}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/2f58c9d884813042bce9cf7c66048767dff166785e8b5183c8139db2aa7312d1.eval.golden b/plutus-benchmark/marlowe/test/semantics/2f58c9d884813042bce9cf7c66048767dff166785e8b5183c8139db2aa7312d1.eval.golden index bd1be8d56ed..d634ad164df 100644 --- a/plutus-benchmark/marlowe/test/semantics/2f58c9d884813042bce9cf7c66048767dff166785e8b5183c8139db2aa7312d1.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/2f58c9d884813042bce9cf7c66048767dff166785e8b5183c8139db2aa7312d1.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1585463006 -| mem: 5480838}) \ No newline at end of file +({cpu: 1581047006 +| mem: 5461638}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/30aa34dfbe89e0c43f569929a96c0d2b74c321d13fec0375606325eee9a34a6a.eval.golden b/plutus-benchmark/marlowe/test/semantics/30aa34dfbe89e0c43f569929a96c0d2b74c321d13fec0375606325eee9a34a6a.eval.golden index c52b6ca47e9..9cbf3a132c5 100644 --- a/plutus-benchmark/marlowe/test/semantics/30aa34dfbe89e0c43f569929a96c0d2b74c321d13fec0375606325eee9a34a6a.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/30aa34dfbe89e0c43f569929a96c0d2b74c321d13fec0375606325eee9a34a6a.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1633668262 -| mem: 6204012}) \ No newline at end of file +({cpu: 1621340262 +| mem: 6150412}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/322acde099bc34a929182d5b894214fc87ec88446e2d10625119a9d17fa3ec3d.eval.golden b/plutus-benchmark/marlowe/test/semantics/322acde099bc34a929182d5b894214fc87ec88446e2d10625119a9d17fa3ec3d.eval.golden index 2e66f6d86d4..76e088e1865 100644 --- a/plutus-benchmark/marlowe/test/semantics/322acde099bc34a929182d5b894214fc87ec88446e2d10625119a9d17fa3ec3d.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/322acde099bc34a929182d5b894214fc87ec88446e2d10625119a9d17fa3ec3d.eval.golden @@ -1,2 +1,2 @@ -({cpu: 496823642 -| mem: 1702639}) \ No newline at end of file +({cpu: 494247642 +| mem: 1691439}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/331e4a1bb30f28d7073c54f9a13c10ae19e2e396c299a0ce101ee6bf4b2020db.eval.golden b/plutus-benchmark/marlowe/test/semantics/331e4a1bb30f28d7073c54f9a13c10ae19e2e396c299a0ce101ee6bf4b2020db.eval.golden index 5c080782dba..2d17e081c71 100644 --- a/plutus-benchmark/marlowe/test/semantics/331e4a1bb30f28d7073c54f9a13c10ae19e2e396c299a0ce101ee6bf4b2020db.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/331e4a1bb30f28d7073c54f9a13c10ae19e2e396c299a0ce101ee6bf4b2020db.eval.golden @@ -1,2 +1,2 @@ -({cpu: 652684901 -| mem: 2351199}) \ No newline at end of file +({cpu: 649372901 +| mem: 2336799}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/33c3efd79d9234a78262b52bc6bbf8124cb321a467dedb278328215167eca455.eval.golden b/plutus-benchmark/marlowe/test/semantics/33c3efd79d9234a78262b52bc6bbf8124cb321a467dedb278328215167eca455.eval.golden index ad4c9f19bb1..29ef8869a62 100644 --- a/plutus-benchmark/marlowe/test/semantics/33c3efd79d9234a78262b52bc6bbf8124cb321a467dedb278328215167eca455.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/33c3efd79d9234a78262b52bc6bbf8124cb321a467dedb278328215167eca455.eval.golden @@ -1,2 +1,2 @@ -({cpu: 982749993 -| mem: 3619966}) \ No newline at end of file +({cpu: 978885993 +| mem: 3603166}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/383683bfcecdab0f4df507f59631c702bd11a81ca3841f47f37633e8aacbb5de.eval.golden b/plutus-benchmark/marlowe/test/semantics/383683bfcecdab0f4df507f59631c702bd11a81ca3841f47f37633e8aacbb5de.eval.golden index ec08182760c..a4e59cedd4e 100644 --- a/plutus-benchmark/marlowe/test/semantics/383683bfcecdab0f4df507f59631c702bd11a81ca3841f47f37633e8aacbb5de.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/383683bfcecdab0f4df507f59631c702bd11a81ca3841f47f37633e8aacbb5de.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1067568540 -| mem: 3939626}) \ No newline at end of file +({cpu: 1060944540 +| mem: 3910826}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/3bb75b2e53eb13f718eacd3263ab4535f9137fabffc9de499a0de7cabb335479.eval.golden b/plutus-benchmark/marlowe/test/semantics/3bb75b2e53eb13f718eacd3263ab4535f9137fabffc9de499a0de7cabb335479.eval.golden index 4775d72d5e5..f96ef93172c 100644 --- a/plutus-benchmark/marlowe/test/semantics/3bb75b2e53eb13f718eacd3263ab4535f9137fabffc9de499a0de7cabb335479.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/3bb75b2e53eb13f718eacd3263ab4535f9137fabffc9de499a0de7cabb335479.eval.golden @@ -1,2 +1,2 @@ -({cpu: 586186205 -| mem: 1947747}) \ No newline at end of file +({cpu: 583794205 +| mem: 1937347}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/3db496e6cd39a8b888a89d0de07dace4397878958cab3b9d9353978b08c36d8a.eval.golden b/plutus-benchmark/marlowe/test/semantics/3db496e6cd39a8b888a89d0de07dace4397878958cab3b9d9353978b08c36d8a.eval.golden index 8b1754750c5..a0b2673781e 100644 --- a/plutus-benchmark/marlowe/test/semantics/3db496e6cd39a8b888a89d0de07dace4397878958cab3b9d9353978b08c36d8a.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/3db496e6cd39a8b888a89d0de07dace4397878958cab3b9d9353978b08c36d8a.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1568809703 -| mem: 5355470}) \ No newline at end of file +({cpu: 1562921703 +| mem: 5329870}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/44a9e339fa25948b48637fe7e10dcfc6d1256319a7b5ce4202cb54dfef8e37e7.eval.golden b/plutus-benchmark/marlowe/test/semantics/44a9e339fa25948b48637fe7e10dcfc6d1256319a7b5ce4202cb54dfef8e37e7.eval.golden index 386a293b23d..68034c172df 100644 --- a/plutus-benchmark/marlowe/test/semantics/44a9e339fa25948b48637fe7e10dcfc6d1256319a7b5ce4202cb54dfef8e37e7.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/44a9e339fa25948b48637fe7e10dcfc6d1256319a7b5ce4202cb54dfef8e37e7.eval.golden @@ -1,2 +1,2 @@ -({cpu: 674304358 -| mem: 2181727}) \ No newline at end of file +({cpu: 671912358 +| mem: 2171327}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/4c3efd13b6c69112a8a888372d56c86e60c232125976f29b1c3e21d9f537845c.eval.golden b/plutus-benchmark/marlowe/test/semantics/4c3efd13b6c69112a8a888372d56c86e60c232125976f29b1c3e21d9f537845c.eval.golden index 14c6a7c7949..b0531dbc130 100644 --- a/plutus-benchmark/marlowe/test/semantics/4c3efd13b6c69112a8a888372d56c86e60c232125976f29b1c3e21d9f537845c.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/4c3efd13b6c69112a8a888372d56c86e60c232125976f29b1c3e21d9f537845c.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1287831373 -| mem: 4856527}) \ No newline at end of file +({cpu: 1278263373 +| mem: 4814927}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/4d7adf91bfc93cebe95a7e054ec17cfbb912b32bd8aecb48a228b50e02b055c8.eval.golden b/plutus-benchmark/marlowe/test/semantics/4d7adf91bfc93cebe95a7e054ec17cfbb912b32bd8aecb48a228b50e02b055c8.eval.golden index 9c83233d5e5..4812061d3d6 100644 --- a/plutus-benchmark/marlowe/test/semantics/4d7adf91bfc93cebe95a7e054ec17cfbb912b32bd8aecb48a228b50e02b055c8.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/4d7adf91bfc93cebe95a7e054ec17cfbb912b32bd8aecb48a228b50e02b055c8.eval.golden @@ -1,2 +1,2 @@ -({cpu: 904967658 -| mem: 3309225}) \ No newline at end of file +({cpu: 900183658 +| mem: 3288425}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/4f9e8d361b85e62db2350dd3ae77463540e7af0d28e1eb68faeecc45f4655f57.eval.golden b/plutus-benchmark/marlowe/test/semantics/4f9e8d361b85e62db2350dd3ae77463540e7af0d28e1eb68faeecc45f4655f57.eval.golden index 751d409c8ee..8e0c694af61 100644 --- a/plutus-benchmark/marlowe/test/semantics/4f9e8d361b85e62db2350dd3ae77463540e7af0d28e1eb68faeecc45f4655f57.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/4f9e8d361b85e62db2350dd3ae77463540e7af0d28e1eb68faeecc45f4655f57.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1961841633 -| mem: 6100850}) \ No newline at end of file +({cpu: 1958713633 +| mem: 6087250}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/52df7c8dfaa5f801cd837faa65f2fd333665fff00a555ce8c55e36ddc003007a.eval.golden b/plutus-benchmark/marlowe/test/semantics/52df7c8dfaa5f801cd837faa65f2fd333665fff00a555ce8c55e36ddc003007a.eval.golden index f7b78602be8..3859fa97dc8 100644 --- a/plutus-benchmark/marlowe/test/semantics/52df7c8dfaa5f801cd837faa65f2fd333665fff00a555ce8c55e36ddc003007a.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/52df7c8dfaa5f801cd837faa65f2fd333665fff00a555ce8c55e36ddc003007a.eval.golden @@ -1,2 +1,2 @@ -({cpu: 373172209 -| mem: 1377099}) \ No newline at end of file +({cpu: 370596209 +| mem: 1365899}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/53ed4db7ab33d6f907eec91a861d1188269be5ae1892d07ee71161bfb55a7cb7.eval.golden b/plutus-benchmark/marlowe/test/semantics/53ed4db7ab33d6f907eec91a861d1188269be5ae1892d07ee71161bfb55a7cb7.eval.golden index 4ec10a25a1b..c2fa0906b12 100644 --- a/plutus-benchmark/marlowe/test/semantics/53ed4db7ab33d6f907eec91a861d1188269be5ae1892d07ee71161bfb55a7cb7.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/53ed4db7ab33d6f907eec91a861d1188269be5ae1892d07ee71161bfb55a7cb7.eval.golden @@ -1,2 +1,2 @@ -({cpu: 463808040 -| mem: 1631783}) \ No newline at end of file +({cpu: 461416040 +| mem: 1621383}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/55dfe42688ad683b638df1fa7700219f00f53b335a85a2825502ab1e0687197e.eval.golden b/plutus-benchmark/marlowe/test/semantics/55dfe42688ad683b638df1fa7700219f00f53b335a85a2825502ab1e0687197e.eval.golden index ff7a2e849c0..2253b55dcb3 100644 --- a/plutus-benchmark/marlowe/test/semantics/55dfe42688ad683b638df1fa7700219f00f53b335a85a2825502ab1e0687197e.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/55dfe42688ad683b638df1fa7700219f00f53b335a85a2825502ab1e0687197e.eval.golden @@ -1,2 +1,2 @@ -({cpu: 556968787 -| mem: 1879289}) \ No newline at end of file +({cpu: 554576787 +| mem: 1868889}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/56333d4e413dbf1a665463bf68067f63c118f38f7539b7ba7167d577c0c8b8ce.eval.golden b/plutus-benchmark/marlowe/test/semantics/56333d4e413dbf1a665463bf68067f63c118f38f7539b7ba7167d577c0c8b8ce.eval.golden index 6c3c3c3392b..e853224cb22 100644 --- a/plutus-benchmark/marlowe/test/semantics/56333d4e413dbf1a665463bf68067f63c118f38f7539b7ba7167d577c0c8b8ce.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/56333d4e413dbf1a665463bf68067f63c118f38f7539b7ba7167d577c0c8b8ce.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1272172539 -| mem: 4702788}) \ No newline at end of file +({cpu: 1264812539 +| mem: 4670788}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/57728d8b19b0e06412786f3dfed9e1894cd0ad1d2bc2bd497ec0ecb68f989d2b.eval.golden b/plutus-benchmark/marlowe/test/semantics/57728d8b19b0e06412786f3dfed9e1894cd0ad1d2bc2bd497ec0ecb68f989d2b.eval.golden index 72d70effabf..907281a462a 100644 --- a/plutus-benchmark/marlowe/test/semantics/57728d8b19b0e06412786f3dfed9e1894cd0ad1d2bc2bd497ec0ecb68f989d2b.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/57728d8b19b0e06412786f3dfed9e1894cd0ad1d2bc2bd497ec0ecb68f989d2b.eval.golden @@ -1,2 +1,2 @@ -({cpu: 518980528 -| mem: 1782167}) \ No newline at end of file +({cpu: 516588528 +| mem: 1771767}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/5abae75af26f45658beccbe48f7c88e74efdfc0b8409ba1e98f95fa5b6caf999.eval.golden b/plutus-benchmark/marlowe/test/semantics/5abae75af26f45658beccbe48f7c88e74efdfc0b8409ba1e98f95fa5b6caf999.eval.golden index b9da0aa3b17..c6d257cbf03 100644 --- a/plutus-benchmark/marlowe/test/semantics/5abae75af26f45658beccbe48f7c88e74efdfc0b8409ba1e98f95fa5b6caf999.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/5abae75af26f45658beccbe48f7c88e74efdfc0b8409ba1e98f95fa5b6caf999.eval.golden @@ -1,2 +1,2 @@ -({cpu: 621634481 -| mem: 2305329}) \ No newline at end of file +({cpu: 617586481 +| mem: 2287729}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/5d0a88250f13c49c20e146819357a808911c878a0e0a7d6f7fe1d4a619e06112.eval.golden b/plutus-benchmark/marlowe/test/semantics/5d0a88250f13c49c20e146819357a808911c878a0e0a7d6f7fe1d4a619e06112.eval.golden index c77edd31263..54e188f71a2 100644 --- a/plutus-benchmark/marlowe/test/semantics/5d0a88250f13c49c20e146819357a808911c878a0e0a7d6f7fe1d4a619e06112.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/5d0a88250f13c49c20e146819357a808911c878a0e0a7d6f7fe1d4a619e06112.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1344636662 -| mem: 4719031}) \ No newline at end of file +({cpu: 1334884662 +| mem: 4676631}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/5e274e0f593511543d41570a4b03646c1d7539062b5728182e073e5760561a66.eval.golden b/plutus-benchmark/marlowe/test/semantics/5e274e0f593511543d41570a4b03646c1d7539062b5728182e073e5760561a66.eval.golden index 643dd7e9a08..979ecbd472a 100644 --- a/plutus-benchmark/marlowe/test/semantics/5e274e0f593511543d41570a4b03646c1d7539062b5728182e073e5760561a66.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/5e274e0f593511543d41570a4b03646c1d7539062b5728182e073e5760561a66.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1190082587 -| mem: 4532399}) \ No newline at end of file +({cpu: 1180146587 +| mem: 4489199}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/5e2c68ac9f62580d626636679679b97109109df7ac1a8ce86d3e43dfb5e4f6bc.eval.golden b/plutus-benchmark/marlowe/test/semantics/5e2c68ac9f62580d626636679679b97109109df7ac1a8ce86d3e43dfb5e4f6bc.eval.golden index 9d6b0149fbc..0070f9195f2 100644 --- a/plutus-benchmark/marlowe/test/semantics/5e2c68ac9f62580d626636679679b97109109df7ac1a8ce86d3e43dfb5e4f6bc.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/5e2c68ac9f62580d626636679679b97109109df7ac1a8ce86d3e43dfb5e4f6bc.eval.golden @@ -1,2 +1,2 @@ -({cpu: 624808375 -| mem: 2331167}) \ No newline at end of file +({cpu: 619656375 +| mem: 2308767}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/5f130d19918807b60eab4c03119d67878fb6c6712c28c54f5a25792049294acc.eval.golden b/plutus-benchmark/marlowe/test/semantics/5f130d19918807b60eab4c03119d67878fb6c6712c28c54f5a25792049294acc.eval.golden index a02e24b7c38..071449a226f 100644 --- a/plutus-benchmark/marlowe/test/semantics/5f130d19918807b60eab4c03119d67878fb6c6712c28c54f5a25792049294acc.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/5f130d19918807b60eab4c03119d67878fb6c6712c28c54f5a25792049294acc.eval.golden @@ -1,2 +1,2 @@ -({cpu: 520817765 -| mem: 1758971}) \ No newline at end of file +({cpu: 518241765 +| mem: 1747771}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/5f306b4b24ff2b39dab6cdc9ac6ca9bb442c1dc6f4e7e412eeb5a3ced42fb642.eval.golden b/plutus-benchmark/marlowe/test/semantics/5f306b4b24ff2b39dab6cdc9ac6ca9bb442c1dc6f4e7e412eeb5a3ced42fb642.eval.golden index f3f7004ac03..cbaa10a34b0 100644 --- a/plutus-benchmark/marlowe/test/semantics/5f306b4b24ff2b39dab6cdc9ac6ca9bb442c1dc6f4e7e412eeb5a3ced42fb642.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/5f306b4b24ff2b39dab6cdc9ac6ca9bb442c1dc6f4e7e412eeb5a3ced42fb642.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1078035946 -| mem: 4013074}) \ No newline at end of file +({cpu: 1071227946 +| mem: 3983474}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/5f3d46c57a56cef6764f96c9de9677ac6e494dd7a4e368d1c8dd9c1f7a4309a5.eval.golden b/plutus-benchmark/marlowe/test/semantics/5f3d46c57a56cef6764f96c9de9677ac6e494dd7a4e368d1c8dd9c1f7a4309a5.eval.golden index 5da5ca933cb..6cd0393ee78 100644 --- a/plutus-benchmark/marlowe/test/semantics/5f3d46c57a56cef6764f96c9de9677ac6e494dd7a4e368d1c8dd9c1f7a4309a5.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/5f3d46c57a56cef6764f96c9de9677ac6e494dd7a4e368d1c8dd9c1f7a4309a5.eval.golden @@ -1,2 +1,2 @@ -({cpu: 811063182 -| mem: 2818961}) \ No newline at end of file +({cpu: 807015182 +| mem: 2801361}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/64c3d5b43f005855ffc4d0950a02fd159aa1575294ea39061b81a194ebb9eaae.eval.golden b/plutus-benchmark/marlowe/test/semantics/64c3d5b43f005855ffc4d0950a02fd159aa1575294ea39061b81a194ebb9eaae.eval.golden index 5cd7df64c1e..13f436dd92d 100644 --- a/plutus-benchmark/marlowe/test/semantics/64c3d5b43f005855ffc4d0950a02fd159aa1575294ea39061b81a194ebb9eaae.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/64c3d5b43f005855ffc4d0950a02fd159aa1575294ea39061b81a194ebb9eaae.eval.golden @@ -1,2 +1,2 @@ -({cpu: 927230227 -| mem: 3481748}) \ No newline at end of file +({cpu: 922630227 +| mem: 3461748}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/65bc4b69b46d18fdff0fadbf00dd5ec2b3e03805fac9d5fb4ff2d3066e53fc7e.eval.golden b/plutus-benchmark/marlowe/test/semantics/65bc4b69b46d18fdff0fadbf00dd5ec2b3e03805fac9d5fb4ff2d3066e53fc7e.eval.golden index dd4d63c9dc4..ffbd5b592c4 100644 --- a/plutus-benchmark/marlowe/test/semantics/65bc4b69b46d18fdff0fadbf00dd5ec2b3e03805fac9d5fb4ff2d3066e53fc7e.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/65bc4b69b46d18fdff0fadbf00dd5ec2b3e03805fac9d5fb4ff2d3066e53fc7e.eval.golden @@ -1,2 +1,2 @@ -({cpu: 79789371260 -| mem: 227184962}) \ No newline at end of file +({cpu: 79784955260 +| mem: 227165762}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/66af9e473d75e3f464971f6879cc0f2ef84bafcb38fbfa1dbc31ac2053628a38.eval.golden b/plutus-benchmark/marlowe/test/semantics/66af9e473d75e3f464971f6879cc0f2ef84bafcb38fbfa1dbc31ac2053628a38.eval.golden index 70b4671318b..a2fcf7c48ff 100644 --- a/plutus-benchmark/marlowe/test/semantics/66af9e473d75e3f464971f6879cc0f2ef84bafcb38fbfa1dbc31ac2053628a38.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/66af9e473d75e3f464971f6879cc0f2ef84bafcb38fbfa1dbc31ac2053628a38.eval.golden @@ -1,2 +1,2 @@ -({cpu: 2659070898 -| mem: 8554532}) \ No newline at end of file +({cpu: 2650238898 +| mem: 8516132}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/675d63836cad11b547d1b4cddd498f04c919d4342612accf40913f9ae9419fac.eval.golden b/plutus-benchmark/marlowe/test/semantics/675d63836cad11b547d1b4cddd498f04c919d4342612accf40913f9ae9419fac.eval.golden index f1dc025ff01..fddd98e8fe1 100644 --- a/plutus-benchmark/marlowe/test/semantics/675d63836cad11b547d1b4cddd498f04c919d4342612accf40913f9ae9419fac.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/675d63836cad11b547d1b4cddd498f04c919d4342612accf40913f9ae9419fac.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1287672893 -| mem: 4857099}) \ No newline at end of file +({cpu: 1277552893 +| mem: 4813099}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/67ba5a9a0245ee3aff4f34852b9889b8c810fccd3dce2a23910bddd35c503b71.eval.golden b/plutus-benchmark/marlowe/test/semantics/67ba5a9a0245ee3aff4f34852b9889b8c810fccd3dce2a23910bddd35c503b71.eval.golden index 20f4fc33c5f..09d7bbf2ee6 100644 --- a/plutus-benchmark/marlowe/test/semantics/67ba5a9a0245ee3aff4f34852b9889b8c810fccd3dce2a23910bddd35c503b71.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/67ba5a9a0245ee3aff4f34852b9889b8c810fccd3dce2a23910bddd35c503b71.eval.golden @@ -1,2 +1,2 @@ -({cpu: 192061552781 -| mem: 541519822}) \ No newline at end of file +({cpu: 192057688781 +| mem: 541503022}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/6d88f7294dd2b5ce02c3dc609bc7715bd508009738401d264bf9b3eb7c6f49c1.eval.golden b/plutus-benchmark/marlowe/test/semantics/6d88f7294dd2b5ce02c3dc609bc7715bd508009738401d264bf9b3eb7c6f49c1.eval.golden index ebf6eda957c..f37c1a1d81b 100644 --- a/plutus-benchmark/marlowe/test/semantics/6d88f7294dd2b5ce02c3dc609bc7715bd508009738401d264bf9b3eb7c6f49c1.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/6d88f7294dd2b5ce02c3dc609bc7715bd508009738401d264bf9b3eb7c6f49c1.eval.golden @@ -1,2 +1,2 @@ -({cpu: 654097952 -| mem: 2394247}) \ No newline at end of file +({cpu: 649865952 +| mem: 2375847}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/70f65b21b77ddb451f3df9d9fb403ced3d10e1e953867cc4900cc25e5b9dec47.eval.golden b/plutus-benchmark/marlowe/test/semantics/70f65b21b77ddb451f3df9d9fb403ced3d10e1e953867cc4900cc25e5b9dec47.eval.golden index 38abaa3c2b8..4c376f90343 100644 --- a/plutus-benchmark/marlowe/test/semantics/70f65b21b77ddb451f3df9d9fb403ced3d10e1e953867cc4900cc25e5b9dec47.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/70f65b21b77ddb451f3df9d9fb403ced3d10e1e953867cc4900cc25e5b9dec47.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1131935245 -| mem: 4046897}) \ No newline at end of file +({cpu: 1126967245 +| mem: 4025297}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/71965c9ccae31f1ffc1d85aa20a356d4ed97a420954018d8301ec4f9783be0d7.eval.golden b/plutus-benchmark/marlowe/test/semantics/71965c9ccae31f1ffc1d85aa20a356d4ed97a420954018d8301ec4f9783be0d7.eval.golden index 1c59e92fdb2..bb471c50943 100644 --- a/plutus-benchmark/marlowe/test/semantics/71965c9ccae31f1ffc1d85aa20a356d4ed97a420954018d8301ec4f9783be0d7.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/71965c9ccae31f1ffc1d85aa20a356d4ed97a420954018d8301ec4f9783be0d7.eval.golden @@ -1,2 +1,2 @@ -({cpu: 601988481 -| mem: 2206327}) \ No newline at end of file +({cpu: 597940481 +| mem: 2188727}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/74c67f2f182b9a0a66c62b95d6fac5ace3f7e71ea3abfc52ffbe3ecb93436ea2.eval.golden b/plutus-benchmark/marlowe/test/semantics/74c67f2f182b9a0a66c62b95d6fac5ace3f7e71ea3abfc52ffbe3ecb93436ea2.eval.golden index a919e9f5fb8..077d4718d26 100644 --- a/plutus-benchmark/marlowe/test/semantics/74c67f2f182b9a0a66c62b95d6fac5ace3f7e71ea3abfc52ffbe3ecb93436ea2.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/74c67f2f182b9a0a66c62b95d6fac5ace3f7e71ea3abfc52ffbe3ecb93436ea2.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1146969332 -| mem: 4278182}) \ No newline at end of file +({cpu: 1142185332 +| mem: 4257382}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/7529b206a78becb793da74b78c04d9d33a2540a1abd79718e681228f4057403a.eval.golden b/plutus-benchmark/marlowe/test/semantics/7529b206a78becb793da74b78c04d9d33a2540a1abd79718e681228f4057403a.eval.golden index fc795ceded2..5305cedf5ee 100644 --- a/plutus-benchmark/marlowe/test/semantics/7529b206a78becb793da74b78c04d9d33a2540a1abd79718e681228f4057403a.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/7529b206a78becb793da74b78c04d9d33a2540a1abd79718e681228f4057403a.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1170026096 -| mem: 4404412}) \ No newline at end of file +({cpu: 1164138096 +| mem: 4378812}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/75a8bb183688bce447e00f435a144c835435e40a5defc6f3b9be68b70b4a3db6.eval.golden b/plutus-benchmark/marlowe/test/semantics/75a8bb183688bce447e00f435a144c835435e40a5defc6f3b9be68b70b4a3db6.eval.golden index 8b693604068..e1080399aa9 100644 --- a/plutus-benchmark/marlowe/test/semantics/75a8bb183688bce447e00f435a144c835435e40a5defc6f3b9be68b70b4a3db6.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/75a8bb183688bce447e00f435a144c835435e40a5defc6f3b9be68b70b4a3db6.eval.golden @@ -1,2 +1,2 @@ -({cpu: 901768264 -| mem: 3294981}) \ No newline at end of file +({cpu: 897168264 +| mem: 3274981}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/7a758e17486d1a30462c32a5d5309bd1e98322a9dcbe277c143ed3aede9d265f.eval.golden b/plutus-benchmark/marlowe/test/semantics/7a758e17486d1a30462c32a5d5309bd1e98322a9dcbe277c143ed3aede9d265f.eval.golden index d2bcd823215..3a4de2743aa 100644 --- a/plutus-benchmark/marlowe/test/semantics/7a758e17486d1a30462c32a5d5309bd1e98322a9dcbe277c143ed3aede9d265f.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/7a758e17486d1a30462c32a5d5309bd1e98322a9dcbe277c143ed3aede9d265f.eval.golden @@ -1,2 +1,2 @@ -({cpu: 783067065 -| mem: 2589980}) \ No newline at end of file +({cpu: 779019065 +| mem: 2572380}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/7cbc5644b745f4ea635aca42cce5e4a4b9d2e61afdb3ac18128e1688c07071ba.eval.golden b/plutus-benchmark/marlowe/test/semantics/7cbc5644b745f4ea635aca42cce5e4a4b9d2e61afdb3ac18128e1688c07071ba.eval.golden index 905421acb2b..39379b45e47 100644 --- a/plutus-benchmark/marlowe/test/semantics/7cbc5644b745f4ea635aca42cce5e4a4b9d2e61afdb3ac18128e1688c07071ba.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/7cbc5644b745f4ea635aca42cce5e4a4b9d2e61afdb3ac18128e1688c07071ba.eval.golden @@ -1,2 +1,2 @@ -({cpu: 975591206 -| mem: 3472944}) \ No newline at end of file +({cpu: 972095206 +| mem: 3457744}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/82213dfdb6a812b40446438767c61a388d2c0cfd0cbf7fd4a372b0dc59fa17e1.eval.golden b/plutus-benchmark/marlowe/test/semantics/82213dfdb6a812b40446438767c61a388d2c0cfd0cbf7fd4a372b0dc59fa17e1.eval.golden index 8410245b49b..b30810d76c1 100644 --- a/plutus-benchmark/marlowe/test/semantics/82213dfdb6a812b40446438767c61a388d2c0cfd0cbf7fd4a372b0dc59fa17e1.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/82213dfdb6a812b40446438767c61a388d2c0cfd0cbf7fd4a372b0dc59fa17e1.eval.golden @@ -1,2 +1,2 @@ -({cpu: 2982383145 -| mem: 9365280}) \ No newline at end of file +({cpu: 2972079145 +| mem: 9320480}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/8c7fdc3da6822b5112074380003524f50fb3a1ce6db4e501df1086773c6c0201.eval.golden b/plutus-benchmark/marlowe/test/semantics/8c7fdc3da6822b5112074380003524f50fb3a1ce6db4e501df1086773c6c0201.eval.golden index aa2fefb6746..7560b170bf7 100644 --- a/plutus-benchmark/marlowe/test/semantics/8c7fdc3da6822b5112074380003524f50fb3a1ce6db4e501df1086773c6c0201.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/8c7fdc3da6822b5112074380003524f50fb3a1ce6db4e501df1086773c6c0201.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1740516317 -| mem: 6408258}) \ No newline at end of file +({cpu: 1727268317 +| mem: 6350658}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/8d9ae67656a2911ab15a8e5301c960c69aa2517055197aff6b60a87ff718d66c.eval.golden b/plutus-benchmark/marlowe/test/semantics/8d9ae67656a2911ab15a8e5301c960c69aa2517055197aff6b60a87ff718d66c.eval.golden index a56a871bc32..836e825d86c 100644 --- a/plutus-benchmark/marlowe/test/semantics/8d9ae67656a2911ab15a8e5301c960c69aa2517055197aff6b60a87ff718d66c.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/8d9ae67656a2911ab15a8e5301c960c69aa2517055197aff6b60a87ff718d66c.eval.golden @@ -1,2 +1,2 @@ -({cpu: 831208925 -| mem: 2872500}) \ No newline at end of file +({cpu: 828264925 +| mem: 2859700}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/96e1a2fa3ceb9a402f2a5841a0b645f87b4e8e75beb636692478ec39f74ee221.eval.golden b/plutus-benchmark/marlowe/test/semantics/96e1a2fa3ceb9a402f2a5841a0b645f87b4e8e75beb636692478ec39f74ee221.eval.golden index 28eda1b11ed..8cb38701fcb 100644 --- a/plutus-benchmark/marlowe/test/semantics/96e1a2fa3ceb9a402f2a5841a0b645f87b4e8e75beb636692478ec39f74ee221.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/96e1a2fa3ceb9a402f2a5841a0b645f87b4e8e75beb636692478ec39f74ee221.eval.golden @@ -1,2 +1,2 @@ -({cpu: 874710366 -| mem: 2742755}) \ No newline at end of file +({cpu: 872134366 +| mem: 2731555}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/9fabc4fc3440cdb776b28c9bb1dd49c9a5b1605fe1490aa3f4f64a3fa8881b25.eval.golden b/plutus-benchmark/marlowe/test/semantics/9fabc4fc3440cdb776b28c9bb1dd49c9a5b1605fe1490aa3f4f64a3fa8881b25.eval.golden index 68a641bb9f3..728676a1ee0 100644 --- a/plutus-benchmark/marlowe/test/semantics/9fabc4fc3440cdb776b28c9bb1dd49c9a5b1605fe1490aa3f4f64a3fa8881b25.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/9fabc4fc3440cdb776b28c9bb1dd49c9a5b1605fe1490aa3f4f64a3fa8881b25.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1099536887 -| mem: 3905997}) \ No newline at end of file +({cpu: 1089784887 +| mem: 3863597}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/a85173a832db3ea944fafc406dfe3fa3235254897d6d1d0e21bc380147687bd5.eval.golden b/plutus-benchmark/marlowe/test/semantics/a85173a832db3ea944fafc406dfe3fa3235254897d6d1d0e21bc380147687bd5.eval.golden index 4ec10a25a1b..c2fa0906b12 100644 --- a/plutus-benchmark/marlowe/test/semantics/a85173a832db3ea944fafc406dfe3fa3235254897d6d1d0e21bc380147687bd5.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/a85173a832db3ea944fafc406dfe3fa3235254897d6d1d0e21bc380147687bd5.eval.golden @@ -1,2 +1,2 @@ -({cpu: 463808040 -| mem: 1631783}) \ No newline at end of file +({cpu: 461416040 +| mem: 1621383}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/a9a853b6d083551f4ed2995551af287880ef42aee239a2d9bc5314d127cce592.eval.golden b/plutus-benchmark/marlowe/test/semantics/a9a853b6d083551f4ed2995551af287880ef42aee239a2d9bc5314d127cce592.eval.golden index d2bcd823215..3a4de2743aa 100644 --- a/plutus-benchmark/marlowe/test/semantics/a9a853b6d083551f4ed2995551af287880ef42aee239a2d9bc5314d127cce592.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/a9a853b6d083551f4ed2995551af287880ef42aee239a2d9bc5314d127cce592.eval.golden @@ -1,2 +1,2 @@ -({cpu: 783067065 -| mem: 2589980}) \ No newline at end of file +({cpu: 779019065 +| mem: 2572380}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/acb9c83c2b78dabef8674319ad69ba54912cd9997bdf2d8b2998c6bfeef3b122.eval.golden b/plutus-benchmark/marlowe/test/semantics/acb9c83c2b78dabef8674319ad69ba54912cd9997bdf2d8b2998c6bfeef3b122.eval.golden index bf18aa47703..9acd44bc02f 100644 --- a/plutus-benchmark/marlowe/test/semantics/acb9c83c2b78dabef8674319ad69ba54912cd9997bdf2d8b2998c6bfeef3b122.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/acb9c83c2b78dabef8674319ad69ba54912cd9997bdf2d8b2998c6bfeef3b122.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1007220348 -| mem: 3697516}) \ No newline at end of file +({cpu: 1002988348 +| mem: 3679116}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/acce04815e8fd51be93322888250060da173eccf3df3a605bd6bc6a456cde871.eval.golden b/plutus-benchmark/marlowe/test/semantics/acce04815e8fd51be93322888250060da173eccf3df3a605bd6bc6a456cde871.eval.golden index bdd13a1c367..410e1ab20ca 100644 --- a/plutus-benchmark/marlowe/test/semantics/acce04815e8fd51be93322888250060da173eccf3df3a605bd6bc6a456cde871.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/acce04815e8fd51be93322888250060da173eccf3df3a605bd6bc6a456cde871.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1485844027 -| mem: 4216015}) \ No newline at end of file +({cpu: 1484556027 +| mem: 4210415}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/ad6db94ed69b7161c7604568f44358e1cc11e81fea90e41afebd669e51bb60c8.eval.golden b/plutus-benchmark/marlowe/test/semantics/ad6db94ed69b7161c7604568f44358e1cc11e81fea90e41afebd669e51bb60c8.eval.golden index 3e380639be6..7896f817f80 100644 --- a/plutus-benchmark/marlowe/test/semantics/ad6db94ed69b7161c7604568f44358e1cc11e81fea90e41afebd669e51bb60c8.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/ad6db94ed69b7161c7604568f44358e1cc11e81fea90e41afebd669e51bb60c8.eval.golden @@ -1,2 +1,2 @@ -({cpu: 838280194 -| mem: 3124972}) \ No newline at end of file +({cpu: 834048194 +| mem: 3106572}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/b21a4df3b0266ad3481a26d3e3d848aad2fcde89510b29cccce81971e38e0835.eval.golden b/plutus-benchmark/marlowe/test/semantics/b21a4df3b0266ad3481a26d3e3d848aad2fcde89510b29cccce81971e38e0835.eval.golden index 3f5884dca7e..df9c4e70e5e 100644 --- a/plutus-benchmark/marlowe/test/semantics/b21a4df3b0266ad3481a26d3e3d848aad2fcde89510b29cccce81971e38e0835.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/b21a4df3b0266ad3481a26d3e3d848aad2fcde89510b29cccce81971e38e0835.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1987756789 -| mem: 7266708}) \ No newline at end of file +({cpu: 1975796789 +| mem: 7214708}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/b50170cea48ee84b80558c02b15c6df52faf884e504d2c410ad63ba46d8ca35c.eval.golden b/plutus-benchmark/marlowe/test/semantics/b50170cea48ee84b80558c02b15c6df52faf884e504d2c410ad63ba46d8ca35c.eval.golden index 04cf0e1f2e6..ca50e783c15 100644 --- a/plutus-benchmark/marlowe/test/semantics/b50170cea48ee84b80558c02b15c6df52faf884e504d2c410ad63ba46d8ca35c.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/b50170cea48ee84b80558c02b15c6df52faf884e504d2c410ad63ba46d8ca35c.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1362279023 -| mem: 4942332}) \ No newline at end of file +({cpu: 1357311023 +| mem: 4920732}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/bb5345bfbbc460af84e784b900ec270df1948bb1d1e29eacecd022eeb168b315.eval.golden b/plutus-benchmark/marlowe/test/semantics/bb5345bfbbc460af84e784b900ec270df1948bb1d1e29eacecd022eeb168b315.eval.golden index 6d41a777e1b..c2e235a2459 100644 --- a/plutus-benchmark/marlowe/test/semantics/bb5345bfbbc460af84e784b900ec270df1948bb1d1e29eacecd022eeb168b315.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/bb5345bfbbc460af84e784b900ec270df1948bb1d1e29eacecd022eeb168b315.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1345088139 -| mem: 5093332}) \ No newline at end of file +({cpu: 1336440139 +| mem: 5055732}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/c4bb185380df6e9b66fc1ee0564f09a8d1253a51a0c0c7890f2214df9ac19274.eval.golden b/plutus-benchmark/marlowe/test/semantics/c4bb185380df6e9b66fc1ee0564f09a8d1253a51a0c0c7890f2214df9ac19274.eval.golden index 54d80831fa6..d2b3f62584f 100644 --- a/plutus-benchmark/marlowe/test/semantics/c4bb185380df6e9b66fc1ee0564f09a8d1253a51a0c0c7890f2214df9ac19274.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/c4bb185380df6e9b66fc1ee0564f09a8d1253a51a0c0c7890f2214df9ac19274.eval.golden @@ -1,2 +1,2 @@ -({cpu: 880037553 -| mem: 3327729}) \ No newline at end of file +({cpu: 874885553 +| mem: 3305329}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/c9efcb705ee057791f7c18a1de79c49f6e40ba143ce0579f1602fd780cabf153.eval.golden b/plutus-benchmark/marlowe/test/semantics/c9efcb705ee057791f7c18a1de79c49f6e40ba143ce0579f1602fd780cabf153.eval.golden index bec9312dd99..3a1ac54596e 100644 --- a/plutus-benchmark/marlowe/test/semantics/c9efcb705ee057791f7c18a1de79c49f6e40ba143ce0579f1602fd780cabf153.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/c9efcb705ee057791f7c18a1de79c49f6e40ba143ce0579f1602fd780cabf153.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1177945395 -| mem: 4407768}) \ No newline at end of file +({cpu: 1171873395 +| mem: 4381368}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/ccab11ce1a8774135d0e3c9e635631b68af9e276b5dabc66ff669d5650d0be1c.eval.golden b/plutus-benchmark/marlowe/test/semantics/ccab11ce1a8774135d0e3c9e635631b68af9e276b5dabc66ff669d5650d0be1c.eval.golden index 56b28a518a8..bc0c21b84bb 100644 --- a/plutus-benchmark/marlowe/test/semantics/ccab11ce1a8774135d0e3c9e635631b68af9e276b5dabc66ff669d5650d0be1c.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/ccab11ce1a8774135d0e3c9e635631b68af9e276b5dabc66ff669d5650d0be1c.eval.golden @@ -1,2 +1,2 @@ -({cpu: 16309246383 -| mem: 46151098}) \ No newline at end of file +({cpu: 16306486383 +| mem: 46139098}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/cdb9d5c233b288a5a9dcfbd8d5c1831a0bb46eec7a26fa31b80ae69d44805efc.eval.golden b/plutus-benchmark/marlowe/test/semantics/cdb9d5c233b288a5a9dcfbd8d5c1831a0bb46eec7a26fa31b80ae69d44805efc.eval.golden index d5855cb0693..e60a879250a 100644 --- a/plutus-benchmark/marlowe/test/semantics/cdb9d5c233b288a5a9dcfbd8d5c1831a0bb46eec7a26fa31b80ae69d44805efc.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/cdb9d5c233b288a5a9dcfbd8d5c1831a0bb46eec7a26fa31b80ae69d44805efc.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1644398143 -| mem: 5901914}) \ No newline at end of file +({cpu: 1636670143 +| mem: 5868314}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/ced1ea04649e093a501e43f8568ac3e6b37cd3eccec8cac9c70a4857b88a5eb8.eval.golden b/plutus-benchmark/marlowe/test/semantics/ced1ea04649e093a501e43f8568ac3e6b37cd3eccec8cac9c70a4857b88a5eb8.eval.golden index 37100df8a8e..7f2af6faf71 100644 --- a/plutus-benchmark/marlowe/test/semantics/ced1ea04649e093a501e43f8568ac3e6b37cd3eccec8cac9c70a4857b88a5eb8.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/ced1ea04649e093a501e43f8568ac3e6b37cd3eccec8cac9c70a4857b88a5eb8.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1291351465 -| mem: 4782260}) \ No newline at end of file +({cpu: 1285279465 +| mem: 4755860}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/cf542b7df466b228ca2197c2aaa89238a8122f3330fe5b77b3222f570395d9f5.eval.golden b/plutus-benchmark/marlowe/test/semantics/cf542b7df466b228ca2197c2aaa89238a8122f3330fe5b77b3222f570395d9f5.eval.golden index 8fb7ac981ec..27ca484c1b7 100644 --- a/plutus-benchmark/marlowe/test/semantics/cf542b7df466b228ca2197c2aaa89238a8122f3330fe5b77b3222f570395d9f5.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/cf542b7df466b228ca2197c2aaa89238a8122f3330fe5b77b3222f570395d9f5.eval.golden @@ -1,2 +1,2 @@ -({cpu: 626676238 -| mem: 2301109}) \ No newline at end of file +({cpu: 622812238 +| mem: 2284309}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/d1ab832dfab25688f8845bec9387e46ee3f00ba5822197ade7dd540489ec5e95.eval.golden b/plutus-benchmark/marlowe/test/semantics/d1ab832dfab25688f8845bec9387e46ee3f00ba5822197ade7dd540489ec5e95.eval.golden index 377adf63b64..80ea4136b95 100644 --- a/plutus-benchmark/marlowe/test/semantics/d1ab832dfab25688f8845bec9387e46ee3f00ba5822197ade7dd540489ec5e95.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/d1ab832dfab25688f8845bec9387e46ee3f00ba5822197ade7dd540489ec5e95.eval.golden @@ -1,2 +1,2 @@ -({cpu: 237472220896 -| mem: 687903920}) \ No newline at end of file +({cpu: 237469460896 +| mem: 687891920}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/d1c03759810747b7cab38c4296593b38567e11195d161b5bb0a2b58f89b2c65a.eval.golden b/plutus-benchmark/marlowe/test/semantics/d1c03759810747b7cab38c4296593b38567e11195d161b5bb0a2b58f89b2c65a.eval.golden index 96304aa07c3..4c474219d22 100644 --- a/plutus-benchmark/marlowe/test/semantics/d1c03759810747b7cab38c4296593b38567e11195d161b5bb0a2b58f89b2c65a.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/d1c03759810747b7cab38c4296593b38567e11195d161b5bb0a2b58f89b2c65a.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1290303178 -| mem: 4881971}) \ No newline at end of file +({cpu: 1280183178 +| mem: 4837971}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/d64607eb8a1448595081547ea8780886fcbd9e06036460eea3705c88ea867e33.eval.golden b/plutus-benchmark/marlowe/test/semantics/d64607eb8a1448595081547ea8780886fcbd9e06036460eea3705c88ea867e33.eval.golden index e50714d1e09..31e0eab0999 100644 --- a/plutus-benchmark/marlowe/test/semantics/d64607eb8a1448595081547ea8780886fcbd9e06036460eea3705c88ea867e33.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/d64607eb8a1448595081547ea8780886fcbd9e06036460eea3705c88ea867e33.eval.golden @@ -1,2 +1,2 @@ -({cpu: 518082880 -| mem: 1752969}) \ No newline at end of file +({cpu: 515690880 +| mem: 1742569}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/dc241ac6ad1e04fb056d555d6a4f2d08a45d054c6f7f34355fcfeefebef479f3.eval.golden b/plutus-benchmark/marlowe/test/semantics/dc241ac6ad1e04fb056d555d6a4f2d08a45d054c6f7f34355fcfeefebef479f3.eval.golden index 08a2788b166..fc0a3bef003 100644 --- a/plutus-benchmark/marlowe/test/semantics/dc241ac6ad1e04fb056d555d6a4f2d08a45d054c6f7f34355fcfeefebef479f3.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/dc241ac6ad1e04fb056d555d6a4f2d08a45d054c6f7f34355fcfeefebef479f3.eval.golden @@ -1,2 +1,2 @@ -({cpu: 655419786 -| mem: 2357201}) \ No newline at end of file +({cpu: 651923786 +| mem: 2342001}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/dd11ae574eaeab0e9925319768989313a93913fdc347c704ddaa27042757d990.eval.golden b/plutus-benchmark/marlowe/test/semantics/dd11ae574eaeab0e9925319768989313a93913fdc347c704ddaa27042757d990.eval.golden index 791af4c8e27..35a88c7ae93 100644 --- a/plutus-benchmark/marlowe/test/semantics/dd11ae574eaeab0e9925319768989313a93913fdc347c704ddaa27042757d990.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/dd11ae574eaeab0e9925319768989313a93913fdc347c704ddaa27042757d990.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1241392047 -| mem: 4579494}) \ No newline at end of file +({cpu: 1236424047 +| mem: 4557894}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/e26c1cddba16e05fd10c34cbdb16ea6acdbac7c8323256c31c90c520ee6a1080.eval.golden b/plutus-benchmark/marlowe/test/semantics/e26c1cddba16e05fd10c34cbdb16ea6acdbac7c8323256c31c90c520ee6a1080.eval.golden index ee83291a2cc..9409883e294 100644 --- a/plutus-benchmark/marlowe/test/semantics/e26c1cddba16e05fd10c34cbdb16ea6acdbac7c8323256c31c90c520ee6a1080.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/e26c1cddba16e05fd10c34cbdb16ea6acdbac7c8323256c31c90c520ee6a1080.eval.golden @@ -1,2 +1,2 @@ -({cpu: 875222873 -| mem: 2982264}) \ No newline at end of file +({cpu: 872094873 +| mem: 2968664}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/e34b48f80d49360e88c612f4016f7d68cb5678dd8cd5ddb981375a028b3a40a5.eval.golden b/plutus-benchmark/marlowe/test/semantics/e34b48f80d49360e88c612f4016f7d68cb5678dd8cd5ddb981375a028b3a40a5.eval.golden index 7ec750b2d66..a8261dffd9a 100644 --- a/plutus-benchmark/marlowe/test/semantics/e34b48f80d49360e88c612f4016f7d68cb5678dd8cd5ddb981375a028b3a40a5.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/e34b48f80d49360e88c612f4016f7d68cb5678dd8cd5ddb981375a028b3a40a5.eval.golden @@ -1,2 +1,2 @@ -({cpu: 608235070 -| mem: 2211334}) \ No newline at end of file +({cpu: 605107070 +| mem: 2197734}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/e3afd22d01ff12f381cf915fd32358634e6c413f979f2492cf3339319d8cc079.eval.golden b/plutus-benchmark/marlowe/test/semantics/e3afd22d01ff12f381cf915fd32358634e6c413f979f2492cf3339319d8cc079.eval.golden index 466d14513cc..e8b23808bf4 100644 --- a/plutus-benchmark/marlowe/test/semantics/e3afd22d01ff12f381cf915fd32358634e6c413f979f2492cf3339319d8cc079.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/e3afd22d01ff12f381cf915fd32358634e6c413f979f2492cf3339319d8cc079.eval.golden @@ -1,2 +1,2 @@ -({cpu: 425875544 -| mem: 1500989}) \ No newline at end of file +({cpu: 423299544 +| mem: 1489789}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/e9234d2671760874f3f660aae5d3416d18ce6dfd7af4231bdd41b9ec268bc7e1.eval.golden b/plutus-benchmark/marlowe/test/semantics/e9234d2671760874f3f660aae5d3416d18ce6dfd7af4231bdd41b9ec268bc7e1.eval.golden index 655e2bffdee..76c59fdddc4 100644 --- a/plutus-benchmark/marlowe/test/semantics/e9234d2671760874f3f660aae5d3416d18ce6dfd7af4231bdd41b9ec268bc7e1.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/e9234d2671760874f3f660aae5d3416d18ce6dfd7af4231bdd41b9ec268bc7e1.eval.golden @@ -1,2 +1,2 @@ -({cpu: 8467541975 -| mem: 24344926}) \ No newline at end of file +({cpu: 8461469975 +| mem: 24318526}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/eb4a605ed3a64961e9e66ad9631c2813dadf7131740212762ae4483ec749fe1d.eval.golden b/plutus-benchmark/marlowe/test/semantics/eb4a605ed3a64961e9e66ad9631c2813dadf7131740212762ae4483ec749fe1d.eval.golden index 4155000421c..22a5fbfe39f 100644 --- a/plutus-benchmark/marlowe/test/semantics/eb4a605ed3a64961e9e66ad9631c2813dadf7131740212762ae4483ec749fe1d.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/eb4a605ed3a64961e9e66ad9631c2813dadf7131740212762ae4483ec749fe1d.eval.golden @@ -1,2 +1,2 @@ -({cpu: 635589024 -| mem: 2088377}) \ No newline at end of file +({cpu: 633197024 +| mem: 2077977}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/ecb5e8308b57724e0f8533921693f111eba942123cf8660aac2b5bac21ec28f0.eval.golden b/plutus-benchmark/marlowe/test/semantics/ecb5e8308b57724e0f8533921693f111eba942123cf8660aac2b5bac21ec28f0.eval.golden index 1644215507a..7fd0746a8d9 100644 --- a/plutus-benchmark/marlowe/test/semantics/ecb5e8308b57724e0f8533921693f111eba942123cf8660aac2b5bac21ec28f0.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/ecb5e8308b57724e0f8533921693f111eba942123cf8660aac2b5bac21ec28f0.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1826496652 -| mem: 6017516}) \ No newline at end of file +({cpu: 1821160652 +| mem: 5994316}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/f2a8fd2014922f0d8e01541205d47e9bb2d4e54333bdd408cbe7c47c55e73ae4.eval.golden b/plutus-benchmark/marlowe/test/semantics/f2a8fd2014922f0d8e01541205d47e9bb2d4e54333bdd408cbe7c47c55e73ae4.eval.golden index cfbae1332ae..1c142a031e5 100644 --- a/plutus-benchmark/marlowe/test/semantics/f2a8fd2014922f0d8e01541205d47e9bb2d4e54333bdd408cbe7c47c55e73ae4.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/f2a8fd2014922f0d8e01541205d47e9bb2d4e54333bdd408cbe7c47c55e73ae4.eval.golden @@ -1,2 +1,2 @@ -({cpu: 4417165663 -| mem: 13082084}) \ No newline at end of file +({cpu: 4410725663 +| mem: 13054084}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/f339f59bdf92495ed2b14e2e4d3705972b4dda59aa929cffe0f1ff5355db8d79.eval.golden b/plutus-benchmark/marlowe/test/semantics/f339f59bdf92495ed2b14e2e4d3705972b4dda59aa929cffe0f1ff5355db8d79.eval.golden index 75980c9ad05..00dc06c6989 100644 --- a/plutus-benchmark/marlowe/test/semantics/f339f59bdf92495ed2b14e2e4d3705972b4dda59aa929cffe0f1ff5355db8d79.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/f339f59bdf92495ed2b14e2e4d3705972b4dda59aa929cffe0f1ff5355db8d79.eval.golden @@ -1,2 +1,2 @@ -({cpu: 80490187205 -| mem: 226766358}) \ No newline at end of file +({cpu: 80487427205 +| mem: 226754358}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/ffdd68a33afd86f8844c9f5e45b2bda5b035aa02274161b23d57709c0f8b8de6.eval.golden b/plutus-benchmark/marlowe/test/semantics/ffdd68a33afd86f8844c9f5e45b2bda5b035aa02274161b23d57709c0f8b8de6.eval.golden index dd847e9e3c2..17066efdad7 100644 --- a/plutus-benchmark/marlowe/test/semantics/ffdd68a33afd86f8844c9f5e45b2bda5b035aa02274161b23d57709c0f8b8de6.eval.golden +++ b/plutus-benchmark/marlowe/test/semantics/ffdd68a33afd86f8844c9f5e45b2bda5b035aa02274161b23d57709c0f8b8de6.eval.golden @@ -1,2 +1,2 @@ -({cpu: 1578863701 -| mem: 5634236}) \ No newline at end of file +({cpu: 1571135701 +| mem: 5600636}) \ No newline at end of file diff --git a/plutus-benchmark/marlowe/test/semantics/semantics.size.golden b/plutus-benchmark/marlowe/test/semantics/semantics.size.golden index 27f3f80d285..ebad81a5f3f 100644 --- a/plutus-benchmark/marlowe/test/semantics/semantics.size.golden +++ b/plutus-benchmark/marlowe/test/semantics/semantics.size.golden @@ -1 +1 @@ -13603 \ No newline at end of file +13440 \ No newline at end of file diff --git a/plutus-benchmark/nofib/test/clausify-F5.eval.golden b/plutus-benchmark/nofib/test/clausify-F5.eval.golden index 35c840583d8..5ed9ec7f323 100644 --- a/plutus-benchmark/nofib/test/clausify-F5.eval.golden +++ b/plutus-benchmark/nofib/test/clausify-F5.eval.golden @@ -1,2 +1,2 @@ -({cpu: 86929081650 -| mem: 344453180}) \ No newline at end of file +({cpu: 86149289650 +| mem: 341062780}) \ No newline at end of file diff --git a/plutus-benchmark/nofib/test/clausify-F5.pir.golden b/plutus-benchmark/nofib/test/clausify-F5.pir.golden index 88e2e080009..7b3d40c85a2 100644 --- a/plutus-benchmark/nofib/test/clausify-F5.pir.golden +++ b/plutus-benchmark/nofib/test/clausify-F5.pir.golden @@ -44,18 +44,14 @@ {integer} equalsInteger (\(eta : integer) (eta : integer) -> - Bool_match - (ifThenElse {Bool} (equalsInteger eta eta) True False) + ifThenElse {all dead. Ordering} + (equalsInteger eta eta) (/\dead -> EQ) (/\dead -> - Bool_match - (ifThenElse - {Bool} - (lessThanEqualsInteger eta eta) - True - False) + ifThenElse {all dead. Ordering} + (lessThanEqualsInteger eta eta) (/\dead -> LT) (/\dead -> GT) {all dead. dead}) @@ -69,16 +65,16 @@ (\(x : integer) (y : integer) -> ifThenElse {Bool} (lessThanInteger x y) False True) (\(x : integer) (y : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger x y) True False) + ifThenElse {all dead. integer} + (lessThanEqualsInteger x y) (/\dead -> y) (/\dead -> x) {all dead. dead}) (\(x : integer) (y : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger x y) True False) + ifThenElse {all dead. integer} + (lessThanEqualsInteger x y) (/\dead -> x) (/\dead -> y) {all dead. dead}) @@ -371,16 +367,14 @@ {all dead. dead}) in letrec - !go : - List Formula -> List (Tuple2 (List integer) (List integer)) + !go : List Formula -> List (Tuple2 (List integer) (List integer)) = \(ds : List Formula) -> List_match {Formula} ds {all dead. List (Tuple2 (List integer) (List integer))} (/\dead -> Nil {Tuple2 (List integer) (List integer)}) - (\(x : Formula) - (xs : List Formula) -> + (\(x : Formula) (xs : List Formula) -> /\dead -> let !x : List (Tuple2 (List integer) (List integer)) = go xs @@ -393,314 +387,329 @@ (Nil {integer}) (Nil {integer})) in - Bool_match - (Tuple2_match - {List integer} - {List integer} - cp - {Bool} - (\(c : List integer) - (a : List integer) -> - let - !x : - List integer - = (let - a = List integer - in - \(c : integer -> a -> a) - (n : a) -> - letrec - !go : - List integer -> a - = \(ds : List integer) -> - List_match - {integer} - ds - {all dead. a} - (/\dead -> n) - (\(y : integer) -> - letrec - !go : - List integer -> Bool - = \(ds : List integer) -> - List_match - {integer} - ds - {all dead. Bool} - (/\dead -> False) - (\(x : integer) - (xs : - List integer) -> - /\dead -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger - y - x) - True - False) - {all dead. - Bool} - (/\dead -> - True) - (/\dead -> - go xs) - {all dead. - dead}) - {all dead. dead} - in - \(ys : List integer) -> - /\dead -> - let - !ds : a = go ys - in - Bool_match - (go a) - {all dead. a} - (/\dead -> c y ds) - (/\dead -> ds) - {all dead. dead}) - {all dead. dead} - in - go c) - (\(ds : integer) (ds : List integer) -> - Cons {integer} ds ds) - (Nil {integer}) - in - Bool_match - (`$fEqNil_$c==` - {integer} - equalsInteger - x - (Nil {integer})) - {all dead. Bool} - (/\dead -> False) - (/\dead -> True) - {all dead. dead})) + Tuple2_match + {List integer} + {List integer} + cp {all dead. List (Tuple2 (List integer) (List integer))} - (/\dead -> x) - (/\dead -> - insert - {Tuple2 (List integer) (List integer)} - ((let - a = List integer - in - /\b -> - \(v : Ord a) (v : Ord b) -> - CConsOrd - {Tuple2 a b} - (\(eta : Tuple2 a b) (eta : Tuple2 a b) -> - Tuple2_match - {a} - {b} - eta - {Bool} - (\(a : a) (b : b) -> + (\(c : List integer) (a : List integer) -> + Bool_match + (let + !x : List integer + = (let + a = List integer + in + \(c : integer -> a -> a) (n : a) -> + letrec + !go : List integer -> a + = \(ds : List integer) -> + List_match + {integer} + ds + {all dead. a} + (/\dead -> n) + (\(y : integer) -> + letrec + !go : List integer -> Bool + = \(ds : List integer) -> + List_match + {integer} + ds + {all dead. Bool} + (/\dead -> False) + (\(x : integer) + (xs : + List integer) -> + /\dead -> + ifThenElse + {all dead. Bool} + (equalsInteger + y + x) + (/\dead -> True) + (/\dead -> + go xs) + {all dead. + dead}) + {all dead. dead} + in + \(ys : List integer) -> + /\dead -> + let + !ds : a = go ys + in + Bool_match + (go a) + {all dead. a} + (/\dead -> c y ds) + (/\dead -> ds) + {all dead. dead}) + {all dead. dead} + in + go c) + (\(ds : integer) (ds : List integer) -> + Cons {integer} ds ds) + (Nil {integer}) + in + Bool_match + (`$fEqNil_$c==` + {integer} + equalsInteger + x + (Nil {integer})) + {all dead. Bool} + (/\dead -> False) + (/\dead -> True) + {all dead. dead}) + {all dead. List (Tuple2 (List integer) (List integer))} + (/\dead -> x) + (/\dead -> + insert + {Tuple2 (List integer) (List integer)} + ((let + a = List integer + in + /\b -> + \(v : Ord a) (v : Ord b) -> + CConsOrd + {Tuple2 a b} + (\(eta : Tuple2 a b) (eta : Tuple2 a b) -> Tuple2_match {a} {b} eta {Bool} - (\(a' : a) (b' : b) -> - Bool_match - (`$p1Ord` {a} v a a') - {all dead. Bool} - (/\dead -> `$p1Ord` {b} v b b') - (/\dead -> False) - {all dead. dead}))) - (\(ds : Tuple2 a b) (ds : Tuple2 a b) -> - Tuple2_match - {a} - {b} - ds - {Ordering} - (\(a : a) (b : b) -> + (\(a : a) (b : b) -> + Tuple2_match + {a} + {b} + eta + {Bool} + (\(a' : a) (b' : b) -> + Bool_match + (`$p1Ord` {a} v a a') + {all dead. Bool} + (/\dead -> + `$p1Ord` {b} v b b') + (/\dead -> False) + {all dead. dead}))) + (\(ds : Tuple2 a b) (ds : Tuple2 a b) -> Tuple2_match {a} {b} ds {Ordering} - (\(a' : a) -> - let - ~defaultBody : Ordering - = compare {a} v a a' - in - \(b' : b) -> - Ordering_match - (compare {a} v a a') - {all dead. Ordering} - (/\dead -> compare {b} v b b') - (/\dead -> defaultBody) - (/\dead -> defaultBody) - {all dead. dead}))) - (\(x : Tuple2 a b) (y : Tuple2 a b) -> - Tuple2_match - {a} - {b} - x - {Bool} - (\(ipv : a) (ipv : b) -> + (\(a : a) (b : b) -> + Tuple2_match + {a} + {b} + ds + {Ordering} + (\(a' : a) -> + let + ~defaultBody : Ordering + = compare {a} v a a' + in + \(b' : b) -> + Ordering_match + (compare {a} v a a') + {all dead. Ordering} + (/\dead -> + compare {b} v b b') + (/\dead -> defaultBody) + (/\dead -> defaultBody) + {all dead. dead}))) + (\(x : Tuple2 a b) (y : Tuple2 a b) -> Tuple2_match {a} {b} - y + x {Bool} (\(ipv : a) (ipv : b) -> - Ordering_match - (compare {a} v ipv ipv) - {all dead. Bool} - (/\dead -> + Tuple2_match + {a} + {b} + y + {Bool} + (\(ipv : a) (ipv : b) -> Ordering_match - (compare {b} v ipv ipv) + (compare {a} v ipv ipv) {all dead. Bool} - (/\dead -> False) + (/\dead -> + Ordering_match + (compare + {b} + v + ipv + ipv) + {all dead. Bool} + (/\dead -> False) + (/\dead -> False) + (/\dead -> True) + {all dead. dead}) (/\dead -> False) (/\dead -> True) - {all dead. dead}) - (/\dead -> False) - (/\dead -> True) - {all dead. dead}))) - (\(x : Tuple2 a b) (y : Tuple2 a b) -> - Tuple2_match - {a} - {b} - x - {Bool} - (\(ipv : a) (ipv : b) -> + {all dead. dead}))) + (\(x : Tuple2 a b) (y : Tuple2 a b) -> Tuple2_match {a} {b} - y + x {Bool} (\(ipv : a) (ipv : b) -> - Ordering_match - (compare {a} v ipv ipv) - {all dead. Bool} - (/\dead -> + Tuple2_match + {a} + {b} + y + {Bool} + (\(ipv : a) (ipv : b) -> Ordering_match - (compare {b} v ipv ipv) + (compare {a} v ipv ipv) {all dead. Bool} - (/\dead -> True) + (/\dead -> + Ordering_match + (compare + {b} + v + ipv + ipv) + {all dead. Bool} + (/\dead -> True) + (/\dead -> False) + (/\dead -> True) + {all dead. dead}) (/\dead -> False) (/\dead -> True) - {all dead. dead}) - (/\dead -> False) - (/\dead -> True) - {all dead. dead}))) - (\(x : Tuple2 a b) (y : Tuple2 a b) -> - Tuple2_match - {a} - {b} - x - {Bool} - (\(ipv : a) (ipv : b) -> + {all dead. dead}))) + (\(x : Tuple2 a b) (y : Tuple2 a b) -> Tuple2_match {a} {b} - y + x {Bool} (\(ipv : a) (ipv : b) -> - Ordering_match - (compare {a} v ipv ipv) - {all dead. Bool} - (/\dead -> + Tuple2_match + {a} + {b} + y + {Bool} + (\(ipv : a) (ipv : b) -> Ordering_match - (compare {b} v ipv ipv) + (compare {a} v ipv ipv) {all dead. Bool} - (/\dead -> False) + (/\dead -> + Ordering_match + (compare + {b} + v + ipv + ipv) + {all dead. Bool} + (/\dead -> False) + (/\dead -> True) + (/\dead -> False) + {all dead. dead}) (/\dead -> True) (/\dead -> False) - {all dead. dead}) - (/\dead -> True) - (/\dead -> False) - {all dead. dead}))) - (\(x : Tuple2 a b) (y : Tuple2 a b) -> - Tuple2_match - {a} - {b} - x - {Bool} - (\(ipv : a) (ipv : b) -> + {all dead. dead}))) + (\(x : Tuple2 a b) (y : Tuple2 a b) -> Tuple2_match {a} {b} - y + x {Bool} (\(ipv : a) (ipv : b) -> - Ordering_match - (compare {a} v ipv ipv) - {all dead. Bool} - (/\dead -> + Tuple2_match + {a} + {b} + y + {Bool} + (\(ipv : a) (ipv : b) -> Ordering_match - (compare {b} v ipv ipv) + (compare {a} v ipv ipv) {all dead. Bool} - (/\dead -> True) + (/\dead -> + Ordering_match + (compare + {b} + v + ipv + ipv) + {all dead. Bool} + (/\dead -> True) + (/\dead -> True) + (/\dead -> False) + {all dead. dead}) (/\dead -> True) (/\dead -> False) - {all dead. dead}) - (/\dead -> True) - (/\dead -> False) - {all dead. dead}))) - (\(x : Tuple2 a b) (y : Tuple2 a b) -> - Tuple2_match - {a} - {b} - x - {Tuple2 a b} - (\(ipv : a) (ipv : b) -> + {all dead. dead}))) + (\(x : Tuple2 a b) (y : Tuple2 a b) -> Tuple2_match {a} {b} - y + x {Tuple2 a b} (\(ipv : a) (ipv : b) -> - Ordering_match - (compare {a} v ipv ipv) - {all dead. Tuple2 a b} - (/\dead -> + Tuple2_match + {a} + {b} + y + {Tuple2 a b} + (\(ipv : a) (ipv : b) -> Ordering_match - (compare {b} v ipv ipv) + (compare {a} v ipv ipv) {all dead. Tuple2 a b} - (/\dead -> y) + (/\dead -> + Ordering_match + (compare + {b} + v + ipv + ipv) + {all dead. Tuple2 a b} + (/\dead -> y) + (/\dead -> x) + (/\dead -> y) + {all dead. dead}) (/\dead -> x) (/\dead -> y) - {all dead. dead}) - (/\dead -> x) - (/\dead -> y) - {all dead. dead}))) - (\(x : Tuple2 a b) (y : Tuple2 a b) -> - Tuple2_match - {a} - {b} - x - {Tuple2 a b} - (\(ipv : a) (ipv : b) -> + {all dead. dead}))) + (\(x : Tuple2 a b) (y : Tuple2 a b) -> Tuple2_match {a} {b} - y + x {Tuple2 a b} (\(ipv : a) (ipv : b) -> - Ordering_match - (compare {a} v ipv ipv) - {all dead. Tuple2 a b} - (/\dead -> + Tuple2_match + {a} + {b} + y + {Tuple2 a b} + (\(ipv : a) (ipv : b) -> Ordering_match - (compare {b} v ipv ipv) + (compare {a} v ipv ipv) {all dead. Tuple2 a b} - (/\dead -> x) + (/\dead -> + Ordering_match + (compare + {b} + v + ipv + ipv) + {all dead. Tuple2 a b} + (/\dead -> x) + (/\dead -> y) + (/\dead -> x) + {all dead. dead}) (/\dead -> y) (/\dead -> x) - {all dead. dead}) - (/\dead -> y) - (/\dead -> x) - {all dead. dead})))) - {List integer} - `$dOrd` - `$dOrd`) - cp - x) + {all dead. dead})))) + {List integer} + `$dOrd` + `$dOrd`) + cp + x)) {all dead. dead}) {all dead. dead} in @@ -745,40 +754,95 @@ !dp : Formula = disin p in Bool_match - (Bool_match - (Formula_match - dp - {Bool} - (\(ds : Formula) (ds : Formula) -> True) - (\(default_arg0 : Formula) - (default_arg1 : Formula) -> - False) - (\(default_arg0 : Formula) - (default_arg1 : Formula) -> - False) - (\(default_arg0 : Formula) - (default_arg1 : Formula) -> - False) - (\(default_arg0 : Formula) -> False) - (\(default_arg0 : integer) -> False)) + (Formula_match + dp {all dead. Bool} - (/\dead -> True) - (/\dead -> - Formula_match - dq - {Bool} - (\(ds : Formula) (ds : Formula) -> True) - (\(default_arg0 : Formula) - (default_arg1 : Formula) -> - False) - (\(default_arg0 : Formula) - (default_arg1 : Formula) -> - False) - (\(default_arg0 : Formula) - (default_arg1 : Formula) -> - False) - (\(default_arg0 : Formula) -> False) - (\(default_arg0 : integer) -> False)) + (\(ds : Formula) (ds : Formula) -> /\dead -> True) + (\(default_arg0 : Formula) (default_arg1 : Formula) -> + /\dead -> + Formula_match + dq + {Bool} + (\(ds : Formula) (ds : Formula) -> True) + (\(default_arg0 : Formula) + (default_arg1 : Formula) -> + False) + (\(default_arg0 : Formula) + (default_arg1 : Formula) -> + False) + (\(default_arg0 : Formula) + (default_arg1 : Formula) -> + False) + (\(default_arg0 : Formula) -> False) + (\(default_arg0 : integer) -> False)) + (\(default_arg0 : Formula) (default_arg1 : Formula) -> + /\dead -> + Formula_match + dq + {Bool} + (\(ds : Formula) (ds : Formula) -> True) + (\(default_arg0 : Formula) + (default_arg1 : Formula) -> + False) + (\(default_arg0 : Formula) + (default_arg1 : Formula) -> + False) + (\(default_arg0 : Formula) + (default_arg1 : Formula) -> + False) + (\(default_arg0 : Formula) -> False) + (\(default_arg0 : integer) -> False)) + (\(default_arg0 : Formula) (default_arg1 : Formula) -> + /\dead -> + Formula_match + dq + {Bool} + (\(ds : Formula) (ds : Formula) -> True) + (\(default_arg0 : Formula) + (default_arg1 : Formula) -> + False) + (\(default_arg0 : Formula) + (default_arg1 : Formula) -> + False) + (\(default_arg0 : Formula) + (default_arg1 : Formula) -> + False) + (\(default_arg0 : Formula) -> False) + (\(default_arg0 : integer) -> False)) + (\(default_arg0 : Formula) -> + /\dead -> + Formula_match + dq + {Bool} + (\(ds : Formula) (ds : Formula) -> True) + (\(default_arg0 : Formula) + (default_arg1 : Formula) -> + False) + (\(default_arg0 : Formula) + (default_arg1 : Formula) -> + False) + (\(default_arg0 : Formula) + (default_arg1 : Formula) -> + False) + (\(default_arg0 : Formula) -> False) + (\(default_arg0 : integer) -> False)) + (\(default_arg0 : integer) -> + /\dead -> + Formula_match + dq + {Bool} + (\(ds : Formula) (ds : Formula) -> True) + (\(default_arg0 : Formula) + (default_arg1 : Formula) -> + False) + (\(default_arg0 : Formula) + (default_arg1 : Formula) -> + False) + (\(default_arg0 : Formula) + (default_arg1 : Formula) -> + False) + (\(default_arg0 : Formula) -> False) + (\(default_arg0 : integer) -> False)) {all dead. dead}) {all dead. Formula} (/\dead -> disin (Dis dp dq)) diff --git a/plutus-benchmark/nofib/test/clausify-F5.size.golden b/plutus-benchmark/nofib/test/clausify-F5.size.golden index 7dbc594e58c..4fb34a5f91f 100644 --- a/plutus-benchmark/nofib/test/clausify-F5.size.golden +++ b/plutus-benchmark/nofib/test/clausify-F5.size.golden @@ -1 +1 @@ -1596 \ No newline at end of file +1665 \ No newline at end of file diff --git a/plutus-benchmark/nofib/test/knights10-4x4.pir.golden b/plutus-benchmark/nofib/test/knights10-4x4.pir.golden index 36c98b2cfc2..b08d9974407 100644 --- a/plutus-benchmark/nofib/test/knights10-4x4.pir.golden +++ b/plutus-benchmark/nofib/test/knights10-4x4.pir.golden @@ -57,18 +57,14 @@ {integer} equalsInteger (\(eta : integer) (eta : integer) -> - Bool_match - (ifThenElse {Bool} (equalsInteger eta eta) True False) + ifThenElse {all dead. Ordering} + (equalsInteger eta eta) (/\dead -> EQ) (/\dead -> - Bool_match - (ifThenElse - {Bool} - (lessThanEqualsInteger eta eta) - True - False) + ifThenElse {all dead. Ordering} + (lessThanEqualsInteger eta eta) (/\dead -> LT) (/\dead -> GT) {all dead. dead}) @@ -82,16 +78,16 @@ (\(x : integer) (y : integer) -> ifThenElse {Bool} (lessThanInteger x y) False True) (\(x : integer) (y : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger x y) True False) + ifThenElse {all dead. integer} + (lessThanEqualsInteger x y) (/\dead -> y) (/\dead -> x) {all dead. dead}) (\(x : integer) (y : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger x y) True False) + ifThenElse {all dead. integer} + (lessThanEqualsInteger x y) (/\dead -> x) (/\dead -> y) {all dead. dead}) @@ -146,9 +142,9 @@ (q : List a) (growFn : a -> List a) (finFn : a -> Bool) -> - Bool_match - (ifThenElse {Bool} (equalsInteger 0 depth) True False) + ifThenElse {all dead. List a} + (equalsInteger 0 depth) (/\dead -> Nil {a}) (/\dead -> Bool_match @@ -423,11 +419,11 @@ letrec !go : integer -> List integer = \(a : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger a b) False True) + ifThenElse {all dead. List integer} - (/\dead -> Nil {integer}) + (lessThanEqualsInteger a b) (/\dead -> Cons {integer} a (go (addInteger 1 a))) + (/\dead -> Nil {integer}) {all dead. dead} in go a @@ -616,33 +612,23 @@ (ipv : integer) (ipv : Maybe (Tuple2 integer integer)) (ipv : List (Tuple2 integer integer)) -> - Bool_match - (ifThenElse {Bool} (lessThanInteger x 1) False True) + ifThenElse {all dead. Bool} + (lessThanInteger x 1) + (/\dead -> False) (/\dead -> - Bool_match - (ifThenElse - {Bool} - (lessThanEqualsInteger x ipv) - True - False) + ifThenElse {all dead. Bool} + (lessThanEqualsInteger x ipv) (/\dead -> - Bool_match - (ifThenElse - {Bool} - (lessThanInteger y 1) - False - True) + ifThenElse {all dead. Bool} + (lessThanInteger y 1) + (/\dead -> False) (/\dead -> - Bool_match - (ifThenElse - {Bool} - (lessThanEqualsInteger y ipv) - True - False) + ifThenElse {all dead. Bool} + (lessThanEqualsInteger y ipv) (/\dead -> notIn {Tuple2 integer integer} @@ -661,13 +647,9 @@ {Bool} (\(a' : integer) (b' : integer) -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger a a') - True - False) + ifThenElse {all dead. Bool} + (equalsInteger a a') (/\dead -> equalsInteger b b') (/\dead -> False) @@ -676,11 +658,9 @@ ipv) (/\dead -> False) {all dead. dead}) - (/\dead -> False) {all dead. dead}) (/\dead -> False) {all dead. dead}) - (/\dead -> False) {all dead. dead})) !possibleMoves : ChessSet -> List Direction = \(board : ChessSet) -> @@ -1005,17 +985,13 @@ !ds : a = go ys in c - (Bool_match - (ifThenElse - {Bool} - (equalsInteger - 0 - (remainderInteger - boardSize - 2)) - True - False) + (ifThenElse {all dead. ChessSet} + (equalsInteger + 0 + (remainderInteger + boardSize + 2)) (/\dead -> Board boardSize @@ -1089,9 +1065,9 @@ letrec !go : integer -> List integer = \(n : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger n 0) True False) + ifThenElse {all dead. List integer} + (lessThanEqualsInteger n 0) (/\dead -> Nil {integer}) (/\dead -> Cons {integer} x (go (subtractInteger n 1))) {all dead. dead} @@ -1166,13 +1142,9 @@ ds {a} (\(y : integer) (x : ChessSet) -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger 1 y) - True - False) + ifThenElse {all dead. a} + (equalsInteger 1 y) (/\dead -> c x ds) (/\dead -> ds) {all dead. dead})) @@ -1190,9 +1162,9 @@ `$fFoldableNil_$cfoldr` singles in - Bool_match - (ifThenElse {Bool} (equalsInteger 0 l) True False) + ifThenElse {all dead. List ChessSet} + (equalsInteger 0 l) (/\dead -> go (quickSort @@ -1510,13 +1482,9 @@ {all dead. dead})))) (descAndNo y))) (/\dead -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger 1 l) - True - False) + ifThenElse {all dead. List ChessSet} + (equalsInteger 1 l) (/\dead -> singles) (/\dead -> Nil {ChessSet}) {all dead. dead}) @@ -1581,13 +1549,9 @@ (ipv : integer) (ipv : Maybe (Tuple2 integer integer)) (ipv : List (Tuple2 integer integer)) -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger ipv (multiplyInteger ipv ipv)) - True - False) + ifThenElse {all dead. Bool} + (equalsInteger ipv (multiplyInteger ipv ipv)) (/\dead -> canMoveTo (Maybe_match diff --git a/plutus-benchmark/nofib/test/queens4-bt.pir.golden b/plutus-benchmark/nofib/test/queens4-bt.pir.golden index 426ea8b53b8..01a820050e3 100644 --- a/plutus-benchmark/nofib/test/queens4-bt.pir.golden +++ b/plutus-benchmark/nofib/test/queens4-bt.pir.golden @@ -273,13 +273,9 @@ (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger a x) - True - False) + ifThenElse {all dead. Bool} + (equalsInteger a x) (/\dead -> False) (/\dead -> go xs) {all dead. dead}) @@ -408,15 +404,15 @@ {List Assign} {ConflictSet} s - (Maybe_match - {Tuple2 integer integer} - (CSP_match - csp - {Maybe (Tuple2 integer integer)} - (\(ds : integer) - (ds : integer) - (ds : Assign -> Assign -> Bool) -> - List_match + (CSP_match + csp + {all dead. ConflictSet} + (\(ds : integer) + (ds : integer) + (ds : Assign -> Assign -> Bool) -> + Maybe_match + {Tuple2 integer integer} + (List_match {Assign} s {all dead. Maybe (Tuple2 integer integer)} @@ -457,42 +453,42 @@ (val : integer) -> var)))) {all dead. dead}) - {all dead. dead})) - {all dead. ConflictSet} - (\(ds : Tuple2 integer integer) -> - /\dead -> - Tuple2_match - {integer} - {integer} - ds - {ConflictSet} - (\(a : integer) (b : integer) -> - Known - ((let - a = List integer - in - \(c : integer -> a -> a) (n : a) -> - c a (c b n)) - (\(ds : integer) (ds : List integer) -> - Cons {integer} ds ds) - (Nil {integer})))) - (/\dead -> - Bool_match - (complete csp s) + {all dead. dead}) {all dead. ConflictSet} - (/\dead -> Known (Nil {integer})) - (/\dead -> Unknown) - {all dead. dead}) + (\(ds : Tuple2 integer integer) -> + /\dead -> + Tuple2_match + {integer} + {integer} + ds + {ConflictSet} + (\(a : integer) (b : integer) -> + Known + ((let + a = List integer + in + \(c : integer -> a -> a) (n : a) -> + c a (c b n)) + (\(ds : integer) (ds : List integer) -> + Cons {integer} ds ds) + (Nil {integer})))) + (/\dead -> + Bool_match + (complete csp s) + {all dead. ConflictSet} + (/\dead -> Known (Nil {integer})) + (/\dead -> Unknown) + {all dead. dead})) {all dead. dead})) in letrec !interval : integer -> integer -> List integer = \(a : integer) (b : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger a b) False True) + ifThenElse {all dead. List integer} - (/\dead -> Nil {integer}) + (lessThanEqualsInteger a b) (/\dead -> Cons {integer} a (interval (addInteger 1 a) b)) + (/\dead -> Nil {integer}) {all dead. dead} in let @@ -942,9 +938,9 @@ (/\dead -> traceError {ConflictSet} "PT7") (\(x : ConflictSet) (xs : List ConflictSet) -> /\dead -> - Bool_match - (ifThenElse {Bool} (equalsInteger 0 ds) True False) + ifThenElse {all dead. ConflictSet} + (equalsInteger 0 ds) (/\dead -> x) (/\dead -> go (subtractInteger ds 1) xs) {all dead. dead}) @@ -1017,13 +1013,9 @@ val)) 1 in - Bool_match - (ifThenElse - {Bool} - (lessThanInteger n 0) - True - False) + ifThenElse {all dead. ConflictSet} + (lessThanInteger n 0) (/\dead -> traceError {ConflictSet} "PT6") (/\dead -> go n ds) {all dead. dead} @@ -1057,9 +1049,9 @@ t !abs : integer -> integer = \(n : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanInteger n 0) True False) + ifThenElse {all dead. integer} + (lessThanInteger n 0) (/\dead -> subtractInteger 0 n) (/\dead -> n) {all dead. dead} @@ -1210,23 +1202,19 @@ {Bool} (\(j : integer) (n : integer) -> Bool_match - (Bool_match - (ifThenElse {Bool} (equalsInteger m n) True False) + (ifThenElse {all dead. Bool} + (equalsInteger m n) (/\dead -> False) (/\dead -> True) {all dead. dead}) {all dead. Bool} (/\dead -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger - (abs (subtractInteger i j)) - (abs (subtractInteger m n))) - True - False) + ifThenElse {all dead. Bool} + (equalsInteger + (abs (subtractInteger i j)) + (abs (subtractInteger m n))) (/\dead -> False) (/\dead -> True) {all dead. dead}) @@ -1515,25 +1503,26 @@ (filter {Tuple2 (List Assign) ConflictSet} (\(eta : Tuple2 (List Assign) ConflictSet) -> - ConflictSet_match - (Tuple2_match - {List Assign} - {ConflictSet} - eta - {ConflictSet} - (\(ds : List Assign) (b : ConflictSet) -> b)) + Tuple2_match + {List Assign} + {ConflictSet} + eta {all dead. Bool} - (\(ds : List integer) -> - /\dead -> - List_match - {integer} - ds - {all dead. Bool} - (/\dead -> True) - (\(ipv : integer) (ipv : List integer) -> - /\dead -> False) - {all dead. dead}) - (/\dead -> False) + (\(ds : List Assign) (b : ConflictSet) -> + ConflictSet_match + b + {all dead. Bool} + (\(ds : List integer) -> + /\dead -> + List_match + {integer} + ds + {all dead. Bool} + (/\dead -> True) + (\(ipv : integer) (ipv : List integer) -> + /\dead -> False) + {all dead. dead}) + (/\dead -> False)) {all dead. dead}) (leaves {Tuple2 (List Assign) ConflictSet} @@ -1566,26 +1555,27 @@ lab) in Bool_match - (ConflictSet_match - (Tuple2_match - {List Assign} - {ConflictSet} - x - {ConflictSet} - (\(ds : List Assign) (b : ConflictSet) -> - b)) + (Tuple2_match + {List Assign} + {ConflictSet} + x {all dead. Bool} - (\(ds : List integer) -> - /\dead -> - List_match - {integer} - ds - {all dead. Bool} - (/\dead -> False) - (\(a : integer) (as : List integer) -> - /\dead -> True) - {all dead. dead}) - (/\dead -> False) + (\(ds : List Assign) (b : ConflictSet) -> + ConflictSet_match + b + {all dead. Bool} + (\(ds : List integer) -> + /\dead -> + List_match + {integer} + ds + {all dead. Bool} + (/\dead -> False) + (\(a : integer) + (as : List integer) -> + /\dead -> True) + {all dead. dead}) + (/\dead -> False)) {all dead. dead}) {all dead. Bool} (/\dead -> False) @@ -1661,27 +1651,23 @@ ds) {all dead. dead} in - Bool_match - (ifThenElse - {Bool} - (lessThanInteger - (List_match - {Assign} - ss - {integer} - 0 - (\(ds : Assign) - (ds : List Assign) -> - Assign_match - ds - {integer} - (\(var : integer) - (val : integer) -> - var))) - ds) - True - False) + ifThenElse {all dead. a} + (lessThanInteger + (List_match + {Assign} + ss + {integer} + 0 + (\(ds : Assign) + (ds : List Assign) -> + Assign_match + ds + {integer} + (\(var : integer) + (val : integer) -> + var))) + ds) (/\dead -> go vallist) (/\dead -> n) {all dead. dead})) diff --git a/plutus-benchmark/nofib/test/queens5-fc.pir.golden b/plutus-benchmark/nofib/test/queens5-fc.pir.golden index e6c74c9c04a..1b55ff44ffa 100644 --- a/plutus-benchmark/nofib/test/queens5-fc.pir.golden +++ b/plutus-benchmark/nofib/test/queens5-fc.pir.golden @@ -273,13 +273,9 @@ (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger a x) - True - False) + ifThenElse {all dead. Bool} + (equalsInteger a x) (/\dead -> False) (/\dead -> go xs) {all dead. dead}) @@ -408,15 +404,15 @@ {List Assign} {ConflictSet} s - (Maybe_match - {Tuple2 integer integer} - (CSP_match - csp - {Maybe (Tuple2 integer integer)} - (\(ds : integer) - (ds : integer) - (ds : Assign -> Assign -> Bool) -> - List_match + (CSP_match + csp + {all dead. ConflictSet} + (\(ds : integer) + (ds : integer) + (ds : Assign -> Assign -> Bool) -> + Maybe_match + {Tuple2 integer integer} + (List_match {Assign} s {all dead. Maybe (Tuple2 integer integer)} @@ -457,42 +453,42 @@ (val : integer) -> var)))) {all dead. dead}) - {all dead. dead})) - {all dead. ConflictSet} - (\(ds : Tuple2 integer integer) -> - /\dead -> - Tuple2_match - {integer} - {integer} - ds - {ConflictSet} - (\(a : integer) (b : integer) -> - Known - ((let - a = List integer - in - \(c : integer -> a -> a) (n : a) -> - c a (c b n)) - (\(ds : integer) (ds : List integer) -> - Cons {integer} ds ds) - (Nil {integer})))) - (/\dead -> - Bool_match - (complete csp s) + {all dead. dead}) {all dead. ConflictSet} - (/\dead -> Known (Nil {integer})) - (/\dead -> Unknown) - {all dead. dead}) + (\(ds : Tuple2 integer integer) -> + /\dead -> + Tuple2_match + {integer} + {integer} + ds + {ConflictSet} + (\(a : integer) (b : integer) -> + Known + ((let + a = List integer + in + \(c : integer -> a -> a) (n : a) -> + c a (c b n)) + (\(ds : integer) (ds : List integer) -> + Cons {integer} ds ds) + (Nil {integer})))) + (/\dead -> + Bool_match + (complete csp s) + {all dead. ConflictSet} + (/\dead -> Known (Nil {integer})) + (/\dead -> Unknown) + {all dead. dead})) {all dead. dead})) in letrec !interval : integer -> integer -> List integer = \(a : integer) (b : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger a b) False True) + ifThenElse {all dead. List integer} - (/\dead -> Nil {integer}) + (lessThanEqualsInteger a b) (/\dead -> Cons {integer} a (interval (addInteger 1 a) b)) + (/\dead -> Nil {integer}) {all dead. dead} in let @@ -942,9 +938,9 @@ (/\dead -> traceError {ConflictSet} "PT7") (\(x : ConflictSet) (xs : List ConflictSet) -> /\dead -> - Bool_match - (ifThenElse {Bool} (equalsInteger 0 ds) True False) + ifThenElse {all dead. ConflictSet} + (equalsInteger 0 ds) (/\dead -> x) (/\dead -> go (subtractInteger ds 1) xs) {all dead. dead}) @@ -1017,13 +1013,9 @@ val)) 1 in - Bool_match - (ifThenElse - {Bool} - (lessThanInteger n 0) - True - False) + ifThenElse {all dead. ConflictSet} + (lessThanInteger n 0) (/\dead -> traceError {ConflictSet} "PT6") (/\dead -> go n ds) {all dead. dead} @@ -1057,9 +1049,9 @@ t !abs : integer -> integer = \(n : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanInteger n 0) True False) + ifThenElse {all dead. integer} + (lessThanInteger n 0) (/\dead -> subtractInteger 0 n) (/\dead -> n) {all dead. dead} @@ -1210,23 +1202,19 @@ {Bool} (\(j : integer) (n : integer) -> Bool_match - (Bool_match - (ifThenElse {Bool} (equalsInteger m n) True False) + (ifThenElse {all dead. Bool} + (equalsInteger m n) (/\dead -> False) (/\dead -> True) {all dead. dead}) {all dead. Bool} (/\dead -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger - (abs (subtractInteger i j)) - (abs (subtractInteger m n))) - True - False) + ifThenElse {all dead. Bool} + (equalsInteger + (abs (subtractInteger i j)) + (abs (subtractInteger m n))) (/\dead -> False) (/\dead -> True) {all dead. dead}) @@ -1515,25 +1503,26 @@ (filter {Tuple2 (List Assign) ConflictSet} (\(eta : Tuple2 (List Assign) ConflictSet) -> - ConflictSet_match - (Tuple2_match - {List Assign} - {ConflictSet} - eta - {ConflictSet} - (\(ds : List Assign) (b : ConflictSet) -> b)) + Tuple2_match + {List Assign} + {ConflictSet} + eta {all dead. Bool} - (\(ds : List integer) -> - /\dead -> - List_match - {integer} - ds - {all dead. Bool} - (/\dead -> True) - (\(ipv : integer) (ipv : List integer) -> - /\dead -> False) - {all dead. dead}) - (/\dead -> False) + (\(ds : List Assign) (b : ConflictSet) -> + ConflictSet_match + b + {all dead. Bool} + (\(ds : List integer) -> + /\dead -> + List_match + {integer} + ds + {all dead. Bool} + (/\dead -> True) + (\(ipv : integer) (ipv : List integer) -> + /\dead -> False) + {all dead. dead}) + (/\dead -> False)) {all dead. dead}) (leaves {Tuple2 (List Assign) ConflictSet} @@ -1566,26 +1555,27 @@ lab) in Bool_match - (ConflictSet_match - (Tuple2_match - {List Assign} - {ConflictSet} - x - {ConflictSet} - (\(ds : List Assign) (b : ConflictSet) -> - b)) + (Tuple2_match + {List Assign} + {ConflictSet} + x {all dead. Bool} - (\(ds : List integer) -> - /\dead -> - List_match - {integer} - ds - {all dead. Bool} - (/\dead -> False) - (\(a : integer) (as : List integer) -> - /\dead -> True) - {all dead. dead}) - (/\dead -> False) + (\(ds : List Assign) (b : ConflictSet) -> + ConflictSet_match + b + {all dead. Bool} + (\(ds : List integer) -> + /\dead -> + List_match + {integer} + ds + {all dead. Bool} + (/\dead -> False) + (\(a : integer) + (as : List integer) -> + /\dead -> True) + {all dead. dead}) + (/\dead -> False)) {all dead. dead}) {all dead. Bool} (/\dead -> False) @@ -1661,27 +1651,23 @@ ds) {all dead. dead} in - Bool_match - (ifThenElse - {Bool} - (lessThanInteger - (List_match - {Assign} - ss - {integer} - 0 - (\(ds : Assign) - (ds : List Assign) -> - Assign_match - ds - {integer} - (\(var : integer) - (val : integer) -> - var))) - ds) - True - False) + ifThenElse {all dead. a} + (lessThanInteger + (List_match + {Assign} + ss + {integer} + 0 + (\(ds : Assign) + (ds : List Assign) -> + Assign_match + ds + {integer} + (\(var : integer) + (val : integer) -> + var))) + ds) (/\dead -> go vallist) (/\dead -> n) {all dead. dead})) diff --git a/plutus-benchmark/script-contexts/test/checkScriptContext1.pir.golden b/plutus-benchmark/script-contexts/test/checkScriptContext1.pir.golden index 05dc88efb12..8e31f6a45f9 100644 --- a/plutus-benchmark/script-contexts/test/checkScriptContext1.pir.golden +++ b/plutus-benchmark/script-contexts/test/checkScriptContext1.pir.golden @@ -1037,13 +1037,9 @@ letrec !euclid : integer -> integer -> integer = \(x : integer) (y : integer) -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger y `$fAdditiveMonoidInteger_$czero`) - True - False) + ifThenElse {all dead. integer} + (equalsInteger y `$fAdditiveMonoidInteger_$czero`) (/\dead -> x) (/\dead -> euclid y (modInteger x y)) {all dead. dead} @@ -1051,22 +1047,14 @@ letrec !unsafeRatio : integer -> integer -> Rational = \(n : integer) (d : integer) -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger d `$fAdditiveMonoidInteger_$czero`) - True - False) + ifThenElse {all dead. Rational} + (equalsInteger d `$fAdditiveMonoidInteger_$czero`) (/\dead -> error {Rational}) (/\dead -> - Bool_match - (ifThenElse - {Bool} - (lessThanInteger d `$fAdditiveMonoidInteger_$czero`) - True - False) + ifThenElse {all dead. Rational} + (lessThanInteger d `$fAdditiveMonoidInteger_$czero`) (/\dead -> unsafeRatio (subtractInteger `$fAdditiveMonoidInteger_$czero` n) @@ -1794,69 +1782,63 @@ unitval) {Unit} (\(txi : TxInfo) (ds : ScriptPurpose) -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger - 0 - (modInteger - (let - !eta : List TxOut - = TxInfo_match - txi - {List TxOut} - (\(ds : List TxInInfo) - (ds : List TxInInfo) - (ds : List TxOut) - (ds : - (\k v -> List (Tuple2 k v)) + ifThenElse + {all dead. Unit} + (equalsInteger + 0 + (modInteger + (let + !eta : List TxOut + = TxInfo_match + txi + {List TxOut} + (\(ds : List TxInInfo) + (ds : List TxInInfo) + (ds : List TxOut) + (ds : + (\k v -> List (Tuple2 k v)) + bytestring + ((\k v -> List (Tuple2 k v)) bytestring - ((\k v -> List (Tuple2 k v)) - bytestring - integer)) - (ds : - (\k v -> List (Tuple2 k v)) + integer)) + (ds : + (\k v -> List (Tuple2 k v)) + bytestring + ((\k v -> List (Tuple2 k v)) + bytestring + integer)) + (ds : List TxCert) + (ds : (\k v -> List (Tuple2 k v)) Credential integer) + (ds : Interval integer) + (ds : List bytestring) + (ds : (\k v -> List (Tuple2 k v)) ScriptPurpose data) + (ds : (\k v -> List (Tuple2 k v)) bytestring data) + (ds : bytestring) + (ds : + (\k v -> List (Tuple2 k v)) + Voter + ((\k v -> List (Tuple2 k v)) + GovernanceActionId + Vote)) + (ds : List ProposalProcedure) + (ds : + Maybe + ((\k v -> List (Tuple2 k v)) bytestring ((\k v -> List (Tuple2 k v)) bytestring - integer)) - (ds : List TxCert) - (ds : - (\k v -> List (Tuple2 k v)) Credential integer) - (ds : Interval integer) - (ds : List bytestring) - (ds : - (\k v -> List (Tuple2 k v)) ScriptPurpose data) - (ds : (\k v -> List (Tuple2 k v)) bytestring data) - (ds : bytestring) - (ds : - (\k v -> List (Tuple2 k v)) - Voter - ((\k v -> List (Tuple2 k v)) - GovernanceActionId - Vote)) - (ds : List ProposalProcedure) - (ds : - Maybe - ((\k v -> List (Tuple2 k v)) - bytestring - ((\k v -> List (Tuple2 k v)) - bytestring - integer))) - (ds : - Maybe + integer))) + (ds : + Maybe + ((\k v -> List (Tuple2 k v)) + bytestring ((\k v -> List (Tuple2 k v)) bytestring - ((\k v -> List (Tuple2 k v)) - bytestring - integer))) -> - ds) - in - go eta) - 2)) - True - False) - {all dead. Unit} + integer))) -> + ds) + in + go eta) + 2)) (/\dead -> Unit) (/\dead -> error {Unit}) {all dead. dead})) diff --git a/plutus-benchmark/script-contexts/test/checkScriptContext2.pir.golden b/plutus-benchmark/script-contexts/test/checkScriptContext2.pir.golden index de5d7926800..56f2d20153c 100644 --- a/plutus-benchmark/script-contexts/test/checkScriptContext2.pir.golden +++ b/plutus-benchmark/script-contexts/test/checkScriptContext2.pir.golden @@ -1024,13 +1024,9 @@ letrec !euclid : integer -> integer -> integer = \(x : integer) (y : integer) -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger y `$fAdditiveMonoidInteger_$czero`) - True - False) + ifThenElse {all dead. integer} + (equalsInteger y `$fAdditiveMonoidInteger_$czero`) (/\dead -> x) (/\dead -> euclid y (modInteger x y)) {all dead. dead} @@ -1038,22 +1034,14 @@ letrec !unsafeRatio : integer -> integer -> Rational = \(n : integer) (d : integer) -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger d `$fAdditiveMonoidInteger_$czero`) - True - False) + ifThenElse {all dead. Rational} + (equalsInteger d `$fAdditiveMonoidInteger_$czero`) (/\dead -> error {Rational}) (/\dead -> - Bool_match - (ifThenElse - {Bool} - (lessThanInteger d `$fAdditiveMonoidInteger_$czero`) - True - False) + ifThenElse {all dead. Rational} + (lessThanInteger d `$fAdditiveMonoidInteger_$czero`) (/\dead -> unsafeRatio (subtractInteger `$fAdditiveMonoidInteger_$czero` n) diff --git a/plutus-core/changelog.d/20230921_180423_michael.peyton-jones_case_of_case.md b/plutus-core/changelog.d/20230921_180423_michael.peyton-jones_case_of_case.md new file mode 100644 index 00000000000..058d88139e8 --- /dev/null +++ b/plutus-core/changelog.d/20230921_180423_michael.peyton-jones_case_of_case.md @@ -0,0 +1,4 @@ +### Added + +- The Plutus IR optimizer now performs case-of-case. + diff --git a/plutus-core/plutus-core.cabal b/plutus-core/plutus-core.cabal index 591daa1f691..e543451bf79 100644 --- a/plutus-core/plutus-core.cabal +++ b/plutus-core/plutus-core.cabal @@ -82,6 +82,7 @@ library PlutusCore PlutusCore.Analysis.Definitions PlutusCore.Annotation + PlutusCore.Arity PlutusCore.Builtin PlutusCore.Builtin.Debug PlutusCore.Builtin.Elaborate @@ -496,6 +497,7 @@ library plutus-ir PlutusIR.Purity PlutusIR.Subst PlutusIR.Transform.Beta + PlutusIR.Transform.CaseOfCase PlutusIR.Transform.CaseReduce PlutusIR.Transform.CommuteFnWithConst PlutusIR.Transform.DeadCode @@ -582,6 +584,7 @@ test-suite plutus-ir-test PlutusIR.Purity.Tests PlutusIR.Scoping.Tests PlutusIR.Transform.Beta.Tests + PlutusIR.Transform.CaseOfCase.Tests PlutusIR.Transform.CommuteFnWithConst.Tests PlutusIR.Transform.DeadCode.Tests PlutusIR.Transform.EvaluateBuiltins.Tests diff --git a/plutus-core/plutus-core/src/PlutusCore/Arity.hs b/plutus-core/plutus-core/src/PlutusCore/Arity.hs new file mode 100644 index 00000000000..6a0ff949623 --- /dev/null +++ b/plutus-core/plutus-core/src/PlutusCore/Arity.hs @@ -0,0 +1,48 @@ +{-# LANGUAGE GADTs #-} +{-# LANGUAGE TypeApplications #-} +module PlutusCore.Arity where + +import Data.Proxy +import PlutusCore +import PlutusCore.Builtin +import Prettyprinter + +-- | Is the next argument a term or a type? +data Param = + TermParam | TypeParam + deriving stock (Show, Eq) + +instance Pretty Param where + pretty = viaShow + +{-| +The (syntactic) arity of a term. That is, a record of the arguments that the +term expects before it may do some work. Since we have both type and lambda +abstractions, this is not a simple argument count, but rather a list of values +indicating whether the next argument should be a term or a type. + +Note that this is the syntactic arity, i.e. it just corresponds to the number of +syntactic lambda and type abstractions on the outside of the term. It is thus +an under-approximation of how many arguments the term may need. +e.g. consider the term @let id = \x -> x in id@: the variable @id@ has syntactic +arity @[]@, but does in fact need an argument before it does any work. +-} +type Arity = [Param] + +-- | Get the 'Arity' from a 'TypeScheme'. +typeSchemeArity :: TypeScheme val args res -> Arity +typeSchemeArity TypeSchemeResult{} = [] +typeSchemeArity (TypeSchemeArrow sch) = TermParam : typeSchemeArity sch +typeSchemeArity (TypeSchemeAll _ sch) = TypeParam : typeSchemeArity sch + +-- | Get the arity of a builtin function from the 'PLC.BuiltinSemanticsVariant'. +builtinArity + :: forall uni fun + . ToBuiltinMeaning uni fun + => Proxy uni + -> BuiltinSemanticsVariant fun + -> fun + -> Arity +builtinArity _ semvar fun = + case toBuiltinMeaning @uni @fun @(Term TyName Name uni fun ()) semvar fun of + BuiltinMeaning sch _ _ -> typeSchemeArity sch diff --git a/plutus-core/plutus-ir/src/PlutusIR/Analysis/Builtins.hs b/plutus-core/plutus-ir/src/PlutusIR/Analysis/Builtins.hs index f2a5df83d5a..f0eccd91ac6 100644 --- a/plutus-core/plutus-ir/src/PlutusIR/Analysis/Builtins.hs +++ b/plutus-core/plutus-ir/src/PlutusIR/Analysis/Builtins.hs @@ -1,19 +1,162 @@ -{-# LANGUAGE KindSignatures #-} -{-# LANGUAGE TemplateHaskell #-} -module PlutusIR.Analysis.Builtins where +{-# LANGUAGE GADTs #-} +{-# LANGUAGE KindSignatures #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE TemplateHaskell #-} +{-# LANGUAGE TypeApplications #-} +module PlutusIR.Analysis.Builtins ( + BuiltinMatcherLike (..), + bmlSplitMatchContext, + bmlBranchArities, + defaultUniMatcherLike, -import Control.Lens.TH + BuiltinsInfo (..), + biSemanticsVariant, + biMatcherLike, + + builtinArityInfo, + + asBuiltinDatatypeMatch, + builtinDatatypeMatchBranchArities) where + +import Control.Lens hiding (parts) +import Data.Functor (void) import Data.Kind +import Data.Map qualified as Map +import Data.Proxy +import PlutusCore.Arity import PlutusCore.Builtin import PlutusCore.Builtin qualified as PLC +import PlutusCore.Default +import PlutusCore.MkPlc (mkIterTyAppNoAnn) +import PlutusIR.Contexts import PlutusPrelude (Default (..)) +-- | The information we need to work with a builtin that is like a datatype matcher. +data BuiltinMatcherLike uni fun = BuiltinMatcherLike + { _bmlSplitMatchContext :: forall tyname name a . + Prism' (AppContext tyname name uni fun a) (SplitMatchContext tyname name uni fun a) + , _bmlBranchArities :: [Arity] + } +makeLenses ''BuiltinMatcherLike + -- | All non-static information about builtins that the compiler might want. data BuiltinsInfo (uni :: Type -> Type) fun = BuiltinsInfo { _biSemanticsVariant :: PLC.BuiltinSemanticsVariant fun + , _biMatcherLike :: Map.Map fun (BuiltinMatcherLike uni fun) } makeLenses ''BuiltinsInfo -instance (Default (BuiltinSemanticsVariant fun)) => Default (BuiltinsInfo uni fun) where - def = BuiltinsInfo def +instance (Ord fun, Default (BuiltinSemanticsVariant fun)) => Default (BuiltinsInfo uni fun) where + def = BuiltinsInfo def mempty + +-- | Get the arity of a builtin function from the 'PLC.BuiltinInfo'. +builtinArityInfo + :: forall uni fun + . ToBuiltinMeaning uni fun + => BuiltinsInfo uni fun + -> fun + -> Arity +builtinArityInfo binfo = builtinArity (Proxy @uni) (binfo ^. biSemanticsVariant) + +-- | Split a builtin 'match'. +asBuiltinDatatypeMatch :: + Ord fun + => BuiltinsInfo uni fun + -> fun + -> Maybe (APrism' (AppContext tyname name uni fun a) (SplitMatchContext tyname name uni fun a)) +asBuiltinDatatypeMatch binfo f + | Just (BuiltinMatcherLike p _) <- Map.lookup f (binfo ^. biMatcherLike) + = Just p + | otherwise = Nothing + +-- | Get the branch arities for a builtin 'match'. +builtinDatatypeMatchBranchArities :: + Ord fun + => BuiltinsInfo uni fun + -> fun + -> Maybe [Arity] +builtinDatatypeMatchBranchArities binfo f + | Just (BuiltinMatcherLike _ arities) <- Map.lookup f (binfo ^. biMatcherLike) + = Just arities + | otherwise = Nothing + +defaultUniMatcherLike :: Map.Map DefaultFun (BuiltinMatcherLike DefaultUni DefaultFun) +defaultUniMatcherLike = Map.fromList + [ (IfThenElse, + BuiltinMatcherLike (prism' reconstructIfThenElse splitIfThenElse) ifThenElseBranchArities) + , (ChooseUnit, + BuiltinMatcherLike (prism' reconstructChooseUnit splitChooseUnit) chooseUnitBranchArities) + , (ChooseList, + BuiltinMatcherLike (prism' reconstructChooseList splitChooseList) chooseListBranchArities) + ] + where + splitIfThenElse + :: AppContext tyname name DefaultUni DefaultFun a + -> Maybe (SplitMatchContext tyname name DefaultUni DefaultFun a) + splitIfThenElse args + -- Okay to use the default semantics variant here as we're assuming the + -- type never changes + | Just Saturated <- saturates args (builtinArity Proxy def IfThenElse) + -- 1. No ty vars + -- 2. Result type comes first + -- 3. Scrutinee next + -- 4. Then branches + , (TypeAppContext resTy resTyAnn (TermAppContext scrut scrutAnn branches)) <- args + = + let + scrutTy = mkTyBuiltin @_ @Bool () + sm = SplitMatchContext mempty (scrut, scrutTy, scrutAnn) (resTy, resTyAnn) branches + in Just sm + | otherwise = Nothing + reconstructIfThenElse (SplitMatchContext _ (scrut, _, scrutAnn) (resTy, resTyAnn) branches) = + TypeAppContext resTy resTyAnn (TermAppContext scrut scrutAnn branches) + -- both branches have no args + ifThenElseBranchArities = [[], []] + + splitChooseUnit + :: AppContext tyname name DefaultUni DefaultFun a + -> Maybe (SplitMatchContext tyname name DefaultUni DefaultFun a) + splitChooseUnit args + -- Okay to use the default semantics variant here as we're assuming the + -- type never changes + | Just Saturated <- saturates args (builtinArity Proxy def ChooseUnit) + -- 1. No ty vars + -- 2. Result type comes first + -- 3. Scrutinee next + -- 4. Then branches + , (TypeAppContext resTy resTyAnn (TermAppContext scrut scrutAnn branches)) <- args + = + let + scrutTy = mkTyBuiltin @_ @() () + sm = SplitMatchContext mempty (scrut, scrutTy, scrutAnn) (resTy, resTyAnn) branches + in Just sm + | otherwise = Nothing + reconstructChooseUnit (SplitMatchContext _ (scrut, _, scrutAnn) (resTy, resTyAnn) branches) = + TypeAppContext resTy resTyAnn (TermAppContext scrut scrutAnn branches) + -- only branch has no args + chooseUnitBranchArities = [[]] + + splitChooseList + :: AppContext tyname name DefaultUni DefaultFun a + -> Maybe (SplitMatchContext tyname name DefaultUni DefaultFun a) + splitChooseList args + -- Okay to use the default semantics variant here as we're assuming the + -- type never changes + | Just Saturated <- saturates args (builtinArity Proxy def ChooseList) + -- 1. One type variable + -- 2. Then the result type + -- 3. Scrutinee next + -- 4. Then branches + , (vars, TypeAppContext resTy resTyAnn (TermAppContext scrut scrutAnn branches)) <- + splitAppContext 1 args + = do + tyArgs <- extractTyArgs vars + let scrutTy = mkIterTyAppNoAnn (mkTyBuiltin @_ @[] ()) (fmap void tyArgs) + sm = SplitMatchContext vars (scrut, scrutTy, scrutAnn) (resTy, resTyAnn) branches + pure sm + | otherwise = Nothing + reconstructChooseList (SplitMatchContext vars (scrut, _, scrutAnn) (resTy, resTyAnn) branches) = + vars <> TypeAppContext resTy resTyAnn (TermAppContext scrut scrutAnn branches) + -- both branches have no args + chooseListBranchArities = [[], []] diff --git a/plutus-core/plutus-ir/src/PlutusIR/Analysis/Dependencies.hs b/plutus-core/plutus-ir/src/PlutusIR/Analysis/Dependencies.hs index a08dc74d851..9a52d66bec0 100644 --- a/plutus-core/plutus-ir/src/PlutusIR/Analysis/Dependencies.hs +++ b/plutus-core/plutus-ir/src/PlutusIR/Analysis/Dependencies.hs @@ -41,10 +41,10 @@ we can use to represent it in the graph. -} data Node = Variable PLC.Unique | Root deriving stock (Show, Eq, Ord) -data DepCtx tyname name uni fun = DepCtx +data DepCtx tyname name uni fun a = DepCtx { _depNode :: Node , _depBuiltinsInfo :: BuiltinsInfo uni fun - , _depVarInfo :: VarsInfo tyname name + , _depVarInfo :: VarsInfo tyname name uni a } makeLenses ''DepCtx @@ -70,14 +70,14 @@ runTermDeps :: , PLC.ToBuiltinMeaning uni fun ) => BuiltinsInfo uni fun -> - VarsInfo tyname name -> + VarsInfo tyname name uni a -> Term tyname name uni fun a -> g runTermDeps binfo vinfo t = flip runReader (DepCtx Root binfo vinfo) $ termDeps t -- | Record some dependencies on the current node. currentDependsOn :: - (DepGraph g, MonadReader (DepCtx tyname name uni fun) m) => + (DepGraph g, MonadReader (DepCtx tyname name uni fun a) m) => [PLC.Unique] -> m g currentDependsOn us = do @@ -86,7 +86,7 @@ currentDependsOn us = do -- | Process the given action with the given name as the current node. withCurrent :: - (MonadReader (DepCtx tyname name uni fun) m, PLC.HasUnique n u) => + (MonadReader (DepCtx tyname name uni fun a) m, PLC.HasUnique n u) => n -> m g -> m g @@ -143,7 +143,7 @@ so that this is visible to the dependency analysis. bindingDeps :: ( DepGraph g - , MonadReader (DepCtx tyname name uni fun) m + , MonadReader (DepCtx tyname name uni fun a) m , PLC.HasUnique tyname PLC.TypeUnique , PLC.HasUnique name PLC.TermUnique , PLC.ToBuiltinMeaning uni fun @@ -192,7 +192,7 @@ bindingDeps b = case b of varDeclDeps :: ( DepGraph g - , MonadReader (DepCtx tyname name uni fun) m + , MonadReader (DepCtx tyname name uni fun a) m , PLC.HasUnique tyname PLC.TypeUnique , PLC.HasUnique name PLC.TermUnique ) => @@ -202,7 +202,7 @@ varDeclDeps (VarDecl _ n ty) = withCurrent n $ typeDeps ty -- Here for completeness, but doesn't do much tyVarDeclDeps :: - (G.Graph g, MonadReader (DepCtx tyname name uni fun) m) => + (G.Graph g, MonadReader (DepCtx tyname name uni fun a) m) => TyVarDecl tyname a -> m g tyVarDeclDeps _ = pure G.empty @@ -212,7 +212,7 @@ term itself depends on (usually 'Root' if it is the real term you are interested -} termDeps :: ( DepGraph g - , MonadReader (DepCtx tyname name uni fun) m + , MonadReader (DepCtx tyname name uni fun a) m , PLC.HasUnique tyname PLC.TypeUnique , PLC.HasUnique name PLC.TermUnique , PLC.ToBuiltinMeaning uni fun @@ -234,7 +234,7 @@ termDeps = \case the type itself depends on (usually 'Root' if it is the real type you are interested in). -} typeDeps :: - (DepGraph g, MonadReader (DepCtx tyname name uni fun) m, PLC.HasUnique tyname PLC.TypeUnique) => + (DepGraph g, MonadReader (DepCtx tyname name uni fun a) m, PLC.HasUnique tyname PLC.TypeUnique) => Type tyname uni a -> m g typeDeps ty = diff --git a/plutus-core/plutus-ir/src/PlutusIR/Analysis/RetainedSize.hs b/plutus-core/plutus-ir/src/PlutusIR/Analysis/RetainedSize.hs index ea766b4570d..ee66d47fd3e 100644 --- a/plutus-core/plutus-ir/src/PlutusIR/Analysis/RetainedSize.hs +++ b/plutus-core/plutus-ir/src/PlutusIR/Analysis/RetainedSize.hs @@ -178,7 +178,7 @@ hasSizeIn (DirectionRetentionMap ss) (Variable (PLC.Unique i)) = i `IntMap.membe termRetentionMap :: (HasUnique tyname TypeUnique, HasUnique name TermUnique, ToBuiltinMeaning uni fun) => BuiltinsInfo uni fun - -> VarsInfo tyname name + -> VarsInfo tyname name uni ann -> Term tyname name uni fun ann -> IntMap Size termRetentionMap binfo vinfo term = depsRetentionMap sizeInfo deps where diff --git a/plutus-core/plutus-ir/src/PlutusIR/Analysis/VarInfo.hs b/plutus-core/plutus-ir/src/PlutusIR/Analysis/VarInfo.hs index 1dd0b795c32..9cf533d1854 100644 --- a/plutus-core/plutus-ir/src/PlutusIR/Analysis/VarInfo.hs +++ b/plutus-core/plutus-ir/src/PlutusIR/Analysis/VarInfo.hs @@ -1,104 +1,91 @@ -{-# LANGUAGE LambdaCase #-} -{-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE LambdaCase #-} +{-# LANGUAGE RankNTypes #-} module PlutusIR.Analysis.VarInfo where import Control.Lens hiding (Strict) +import Data.List.Extra ((!?)) +import Data.Traversable +import PlutusCore.Arity import PlutusCore.Core (funTyArgs) -import PlutusCore.Core qualified as PLC import PlutusCore.Name qualified as PLC import PlutusIR.Core -import Prettyprinter -- | Information about variables and type variables in the program. -data VarsInfo tyname name = VarsInfo - { termVarInfoMap :: PLC.UniqueMap PLC.TermUnique (VarInfo tyname name) - , typeVarInfoMap :: PLC.UniqueMap PLC.TypeUnique (TyVarInfo tyname name) +data VarsInfo tyname name uni a = VarsInfo + { termVarInfoMap :: PLC.UniqueMap PLC.TermUnique (VarInfo tyname name uni a) + , typeVarInfoMap :: PLC.UniqueMap PLC.TypeUnique (TyVarInfo tyname name uni a) } -instance Semigroup (VarsInfo tyname name) where +instance Semigroup (VarsInfo tyname name uni a) where (VarsInfo t ty) <> (VarsInfo t' ty') = VarsInfo (t <> t') (ty <> ty') -instance Monoid (VarsInfo tyname name) where +instance Monoid (VarsInfo tyname name uni a) where mempty = VarsInfo mempty mempty -- | Lookup the 'VarInfo' for a 'name'. lookupVarInfo :: (PLC.HasUnique name PLC.TermUnique) => name - -> VarsInfo tyname name - -> Maybe (VarInfo tyname name) + -> VarsInfo tyname name uni a + -> Maybe (VarInfo tyname name uni a) lookupVarInfo name (VarsInfo vim _) = PLC.lookupName name vim -- | Lookup the 'TyVarInfo' for a 'tyname'. lookupTyVarInfo :: (PLC.HasUnique tyname PLC.TypeUnique) => tyname - -> VarsInfo tyname name - -> Maybe (TyVarInfo tyname name) + -> VarsInfo tyname name uni a + -> Maybe (TyVarInfo tyname name uni a) lookupTyVarInfo name (VarsInfo _ vim) = PLC.lookupName name vim -- | Information about a type variable in the program. -data TyVarInfo tyname name = +data TyVarInfo tyname name uni a = -- | A normal type variable, which could be anything. NormalTyVar -- | A type variable corresponding to a datatype. -- Tells us the number of type variables and the constructors. - | DatatypeTyVar Int [name] + | DatatypeTyVar (Datatype tyname name uni a) -data VarInfo tyname name = +data VarInfo tyname name uni a = -- | A normal term variable, which could be anything. - -- Tells us if it is strictly evaluated, and possibly its arity. - NormalVar Strictness (Maybe Arity) + -- Tells us if it is strictly evaluated, its type, and possibly its arity. + NormalVar Strictness (Type tyname uni a) (Maybe Arity) -- | A term variable corresponding to a datatype constructor. - -- Tells us the arity and the name of the datatype that owns it. - | DatatypeConstructor Arity tyname + -- Tells us the index of the constructor and the name of the datatype that owns it. + | DatatypeConstructor Int tyname -- | A term variable corresponding to a datatype matcher. - -- Tells us the arity and the name of the datatype that owns it. - | DatatypeMatcher Arity tyname + -- Tells us the name of the datatype that owns it. + | DatatypeMatcher tyname --- | Is the next argument a term or a type? -data Param = - TermParam | TypeParam - deriving stock (Show) - -instance Pretty Param where - pretty = viaShow - -{-| -The (syntactic) arity of a term. That is, a record of the arguments that the -term expects before it may do some work. Since we have both type and lambda -abstractions, this is not a simple argument count, but rather a list of values -indicating whether the next argument should be a term or a type. - -Note that this is the syntactic arity, i.e. it just corresponds to the number of -syntactic lambda and type abstractions on the outside of the term. It is thus -an under-approximation of how many arguments the term may need. -e.g. consider the term @let id = \x -> x in id@: the variable @id@ has syntactic -arity @[]@, but does in fact need an argument before it does any work. --} -type Arity = [Param] - -varInfoStrictness :: VarInfo tyname name -> Strictness +varInfoStrictness :: VarInfo tyname name uni a -> Strictness varInfoStrictness = \case - NormalVar s _ -> s + NormalVar s _ _ -> s DatatypeConstructor{} -> Strict DatatypeMatcher{} -> Strict -varInfoArity :: VarInfo tyname name -> Maybe Arity -varInfoArity = \case - NormalVar _ a -> a - DatatypeConstructor a _ -> Just a - DatatypeMatcher a _ -> Just a +varInfoArity :: + (PLC.HasUnique tyname PLC.TypeUnique) + => VarInfo tyname name uni a + -> VarsInfo tyname name uni a + -> Maybe Arity +varInfoArity vinfo vinfos = case vinfo of + NormalVar _ _ a -> a + DatatypeConstructor i dtName -> case lookupTyVarInfo dtName vinfos of + Just (DatatypeTyVar dt) -> datatypeConstructorArity i dt + _ -> Nothing + DatatypeMatcher dtName -> case lookupTyVarInfo dtName vinfos of + Just (DatatypeTyVar dt) -> Just $ datatypeMatcherArity dt + _ -> Nothing termVarInfo :: (PLC.HasUnique name PLC.TermUnique , PLC.HasUnique tyname PLC.TypeUnique) => Term tyname name uni fun a - -> VarsInfo tyname name + -> VarsInfo tyname name uni a termVarInfo = \case Let _ _ bs t -> foldMap bindingVarInfo bs <> termVarInfo t - LamAbs _ n _ t -> - VarsInfo (PLC.insertByName n (NormalVar Strict Nothing) mempty) mempty + LamAbs _ n ty t -> + VarsInfo (PLC.insertByName n (NormalVar Strict ty Nothing) mempty) mempty <> termVarInfo t TyAbs _ n _ t -> VarsInfo mempty (PLC.insertByName n NormalTyVar mempty) @@ -115,37 +102,60 @@ termVarInfo = \case t@(Error{}) -> foldMapOf termSubterms termVarInfo t t@(Builtin{}) -> foldMapOf termSubterms termVarInfo t +datatypeMatcherArity :: Datatype tyname uni fun a -> Arity +datatypeMatcherArity (Datatype _ _ tyvars _ constrs)= + -- One parameter for all the datatype type variables + fmap (const TypeParam) tyvars + -- The scrutineee, and then a type paramter for the result type + ++ [TermParam, TypeParam] + -- One parameter with the case for each constructor + ++ fmap (const TermParam) constrs + +datatypeConstructorArity :: Int -> Datatype tyname uni fun a -> Maybe Arity +datatypeConstructorArity i (Datatype _ _ tyvars _ constrs) = + case constrs !? i of + Just (VarDecl _ _ constrTy) -> Just $ + -- One type parameter for all of the datatype type parameters + fmap (const TypeParam) tyvars + -- One term parameter for all the constructor function type arguments + ++ fmap (const TermParam) (funTyArgs constrTy) + _ -> Nothing + bindingVarInfo :: (PLC.HasUnique name PLC.TermUnique , PLC.HasUnique tyname PLC.TypeUnique) => Binding tyname name uni fun a - -> VarsInfo tyname name + -> VarsInfo tyname name uni a bindingVarInfo = \case -- TODO: arity for term bindings - TermBind _ s (VarDecl _ n _) t -> - VarsInfo (PLC.insertByName n (NormalVar s Nothing) mempty) mempty + TermBind _ s (VarDecl _ n ty) t -> + VarsInfo (PLC.insertByName n (NormalVar s ty Nothing) mempty) mempty <> termVarInfo t TypeBind _ (TyVarDecl _ n _) _ -> VarsInfo mempty (PLC.insertByName n NormalTyVar mempty) - DatatypeBind _ (Datatype _ (TyVarDecl _ tyname _) tyvars matcher constrs) -> + DatatypeBind _ d@(Datatype _ (TyVarDecl _ tyname _) _ matcher constrs) -> let dtInfo = - let info = DatatypeTyVar (length tyvars) (fmap (view PLC.varDeclName) constrs) + let info = DatatypeTyVar d in VarsInfo mempty (PLC.insertByName tyname info mempty) - matcherArity = - -- One parameter for all the datatype type variables - fmap (const TypeParam) tyvars - -- The scrutineee, and then a type paramter for the result type - ++ [TermParam, TypeParam] - -- One parameter with the case for each constructor - ++ fmap (const TermParam) constrs matcherInfo = - let info = DatatypeMatcher matcherArity tyname + let info = DatatypeMatcher tyname in VarsInfo (PLC.insertByName matcher info mempty) mempty - constrArity constrTy = - -- One parameter for all function type arguments - fmap (const TypeParam) (funTyArgs constrTy) - constrInfo (VarDecl _ n ty) = - let info = DatatypeConstructor (constrArity ty) tyname + constrInfo i (VarDecl _ n _) = + let info = DatatypeConstructor i tyname in VarsInfo (PLC.insertByName n info mempty) mempty - in dtInfo <> matcherInfo <> foldMap constrInfo constrs + in dtInfo <> matcherInfo <> ifoldMap constrInfo constrs + +-- | Get the arities of the constructors for the given datatype name. +getConstructorArities + :: (PLC.HasUnique name PLC.TermUnique, PLC.HasUnique tyname PLC.TypeUnique) + => tyname + -> VarsInfo tyname name uni a + -> Maybe [Arity] +getConstructorArities tn vinfo | + Just (DatatypeTyVar (Datatype _ _ _ _ constrs)) <- lookupTyVarInfo tn vinfo + , Just constrArities <- for constrs $ \c -> do + cInfo <- lookupVarInfo (_varDeclName c) vinfo + varInfoArity cInfo vinfo + = Just constrArities + | otherwise = Nothing diff --git a/plutus-core/plutus-ir/src/PlutusIR/Compiler.hs b/plutus-core/plutus-ir/src/PlutusIR/Compiler.hs index b8f80eb1537..b8d9c9777f8 100644 --- a/plutus-core/plutus-ir/src/PlutusIR/Compiler.hs +++ b/plutus-core/plutus-ir/src/PlutusIR/Compiler.hs @@ -30,6 +30,7 @@ module PlutusIR.Compiler ( coInlineHints, coProfile, coRelaxedFloatin, + coCaseOfCaseConservative, coPreserveLogging, coDatatypes, dcoStyle, @@ -54,6 +55,7 @@ import PlutusIR.Compiler.Provenance import PlutusIR.Compiler.Types import PlutusIR.Error import PlutusIR.Transform.Beta qualified as Beta +import PlutusIR.Transform.CaseOfCase qualified as CaseOfCase import PlutusIR.Transform.CaseReduce qualified as CaseReduce import PlutusIR.Transform.CommuteFnWithConst qualified as CommuteFnWithConst import PlutusIR.Transform.DeadCode qualified as DeadCode @@ -116,10 +118,13 @@ availablePasses :: [Pass uni fun] availablePasses = [ Pass "unwrap cancel" (onOption coDoSimplifierUnwrapCancel) (pure . Unwrap.unwrapCancel) , Pass "case reduce" (onOption coDoSimplifierCaseReduce) (pure . CaseReduce.caseReduce) + , Pass "case of case" (onOption coDoSimplifierCaseOfCase) (\t -> do + binfo <- view ccBuiltinsInfo + conservative <- view (ccOpts . coCaseOfCaseConservative) + CaseOfCase.caseOfCase binfo conservative noProvenance t) , Pass "known constructor" (onOption coDoSimplifierKnownCon) KnownCon.knownCon , Pass "beta" (onOption coDoSimplifierBeta) (pure . Beta.beta) - , Pass "strictify bindings" (onOption coDoSimplifierStrictifyBindings) (\t -> - do + , Pass "strictify bindings" (onOption coDoSimplifierStrictifyBindings) (\t -> do binfo <- view ccBuiltinsInfo pure $ StrictifyBindings.strictifyBindings binfo t ) diff --git a/plutus-core/plutus-ir/src/PlutusIR/Compiler/Types.hs b/plutus-core/plutus-ir/src/PlutusIR/Compiler/Types.hs index e29cccd805a..a826ec4611a 100644 --- a/plutus-core/plutus-ir/src/PlutusIR/Compiler/Types.hs +++ b/plutus-core/plutus-ir/src/PlutusIR/Compiler/Types.hs @@ -87,12 +87,14 @@ data CompilationOpts a = CompilationOpts { , _coDoSimplifierBeta :: Bool , _coDoSimplifierInline :: Bool , _coDoSimplifierKnownCon :: Bool + , _coDoSimplifierCaseOfCase :: Bool , _coDoSimplifierEvaluateBuiltins :: Bool , _coDoSimplifierStrictifyBindings :: Bool , _coInlineHints :: InlineHints PLC.Name (Provenance a) -- Profiling , _coProfile :: Bool , _coRelaxedFloatin :: Bool + , _coCaseOfCaseConservative :: Bool -- | Whether to try and preserve the logging beahviour of the program. , _coPreserveLogging :: Bool } deriving stock (Show) @@ -111,6 +113,7 @@ defaultCompilationOpts = CompilationOpts , _coDoSimplifierCaseReduce = True , _coDoSimplifiercommuteFnWithConst = True , _coDoSimplifierKnownCon = True + , _coDoSimplifierCaseOfCase = True , _coDoSimplifierBeta = True , _coDoSimplifierInline = True , _coDoSimplifierEvaluateBuiltins = True @@ -118,6 +121,7 @@ defaultCompilationOpts = CompilationOpts , _coInlineHints = mempty , _coProfile = False , _coRelaxedFloatin = True + , _coCaseOfCaseConservative = True , _coPreserveLogging = False } @@ -133,7 +137,7 @@ data CompilationCtx uni fun a = CompilationCtx { makeLenses ''CompilationCtx toDefaultCompilationCtx - :: (Default (PLC.BuiltinSemanticsVariant fun), Default (PLC.CostingPart uni fun)) + :: (Ord fun, Default (PLC.BuiltinSemanticsVariant fun), Default (PLC.CostingPart uni fun)) => PLC.TypeCheckConfig uni fun -> CompilationCtx uni fun a toDefaultCompilationCtx configPlc = diff --git a/plutus-core/plutus-ir/src/PlutusIR/Contexts.hs b/plutus-core/plutus-ir/src/PlutusIR/Contexts.hs index 2162984e226..8fd86c8295f 100644 --- a/plutus-core/plutus-ir/src/PlutusIR/Contexts.hs +++ b/plutus-core/plutus-ir/src/PlutusIR/Contexts.hs @@ -1,11 +1,19 @@ -{-# LANGUAGE LambdaCase #-} +{-# LANGUAGE LambdaCase #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE TupleSections #-} -- | Datatypes representing 'contexts with holes' in Plutus IR terms. -- -- Useful for focussing on a sub-part of a term and then reconstructing the term, but -- with the context as a reified datatype that can be inspected and modified. module PlutusIR.Contexts where +import Control.Lens +import Data.Functor (void) +import PlutusCore.Arity +import PlutusCore.Name qualified as PLC +import PlutusIR.Analysis.VarInfo import PlutusIR.Core +import PlutusIR.MkPir -- | A context for an iterated term/type application, with the hole at the head of the -- application. @@ -58,6 +66,125 @@ lengthContext = go 0 TermAppContext _ _ ctx -> go (acc+1) ctx TypeAppContext _ _ ctx -> go (acc+1) ctx +splitAppContext + :: Int + -> AppContext tyname name uni fun a + -> (AppContext tyname name uni fun a, AppContext tyname name uni fun a) +splitAppContext = go id + where + go + :: (AppContext tyname name uni fun a -> AppContext tyname name uni fun a) + -> Int + -> AppContext tyname name uni fun a + -> (AppContext tyname name uni fun a, AppContext tyname name uni fun a) + go acc i ctx | i <= 0 = (acc AppContextEnd, ctx) + go acc i ctx = case ctx of + c@AppContextEnd -> (acc c, AppContextEnd) + TermAppContext arg ann ctx' -> go (\end -> acc $ TermAppContext arg ann end) (i-1) ctx' + TypeAppContext arg ann ctx' -> go (\end -> acc $ TypeAppContext arg ann end) (i-1) ctx' + +appendAppContext + :: AppContext tyname name uni fun a + -> AppContext tyname name uni fun a + -> AppContext tyname name uni fun a +appendAppContext ctx1 ctx2 = go ctx1 + where + go AppContextEnd = ctx2 + go (TermAppContext arg ann ctx') = TermAppContext arg ann $ go ctx' + go (TypeAppContext arg ann ctx') = TypeAppContext arg ann $ go ctx' + +instance Semigroup (AppContext tyname name uni fun a) where + (<>) = appendAppContext + +instance Monoid (AppContext tyname name uni fun a) where + mempty = AppContextEnd + +data Saturation = Oversaturated | Undersaturated | Saturated + +-- | Do the given arguments saturate the given arity? +saturates :: AppContext tyname name uni fun a -> Arity -> Maybe Saturation +-- Exactly right +saturates AppContextEnd [] = Just Saturated +-- Parameters left - undersaturated +saturates AppContextEnd _ = Just Undersaturated +-- Match a term parameter to a term arg +saturates (TermAppContext _ _ ctx) (TermParam:arities) = saturates ctx arities +-- Match a type parameter to a type arg +saturates (TypeAppContext _ _ ctx) (TypeParam:arities) = saturates ctx arities +-- Param/arg mismatch +saturates (TermAppContext{}) (TypeParam:_) = Nothing +saturates (TypeAppContext{}) (TermParam:_) = Nothing +-- Arguments lef - undersaturated +saturates (TermAppContext{}) [] = Just Oversaturated +saturates (TypeAppContext{}) [] = Just Oversaturated + +-- | A split up version of the 'AppContext' for a datatype match, with the various +-- parts we might want to look at. +-- +-- We have this datatype to make it easier to abstract over different ways that +-- a match might be constructed at the term level. For example, some builtin +-- "matchers" have the arguments in a different order to the matchers from normal +-- PIR datatypes. +data SplitMatchContext tyname name uni fun a = SplitMatchContext + { smTyVars :: AppContext tyname name uni fun a + , smScrutinee :: (Term tyname name uni fun a, Type tyname uni (), a) + , smResTy :: (Type tyname uni a, a) + , smBranches :: AppContext tyname name uni fun a + } + +extractTyArgs :: AppContext tyname name uni fun a -> Maybe [Type tyname uni a] +extractTyArgs = go [] + where go acc (TypeAppContext ty _ ctx) = go (ty:acc) ctx + go _ (TermAppContext{}) = Nothing + go acc AppContextEnd = Just acc + +-- | Split a normal datatype 'match'. +splitNormalDatatypeMatch + :: (PLC.HasUnique name PLC.TermUnique, PLC.HasUnique tyname PLC.TypeUnique) + => VarsInfo tyname name uni a + -> name + -> AppContext tyname name uni fun a -> Maybe (SplitMatchContext tyname name uni fun a) +splitNormalDatatypeMatch vinfo matcherName args + | Just dmInfo@(DatatypeMatcher dmParentTyname) <- lookupVarInfo matcherName vinfo + -- Needs to be saturated otherwise we won't find the bits! + , Just dmArity <- varInfoArity dmInfo vinfo + , Just Saturated <- saturates args dmArity + , Just (DatatypeTyVar (Datatype _ tyname tyvars _ _)) <- lookupTyVarInfo dmParentTyname vinfo + -- Split up the application into: + -- 1. The initial datatype type instantiations + -- 2. The scrutinee + -- 3. The result type variable instantiation + -- 4. The branches + , (vars, TermAppContext scrut scrutAnn (TypeAppContext resTy resTyAnn branches)) <- + splitAppContext (length tyvars) args + , Just tvs <- extractTyArgs vars + = + let + scrutTy = mkIterTyApp (mkTyVar () (void tyname)) $ ((),) . void <$> tvs + sm = SplitMatchContext vars (scrut, scrutTy, scrutAnn) (resTy, resTyAnn) branches + in Just sm + | otherwise = Nothing + +-- | Reconstruct a normal datatype 'match'. +reconstructNormalDatatypeMatch + :: SplitMatchContext tyname name uni fun a + -> AppContext tyname name uni fun a +reconstructNormalDatatypeMatch + (SplitMatchContext vars (scrut, _, scrutAnn) (resTy, resTyAnn) branches) = + vars <> TermAppContext scrut scrutAnn (TypeAppContext resTy resTyAnn branches) + +-- | Split a normal datatype 'match'. +asNormalDatatypeMatch + :: (PLC.HasUnique name PLC.TermUnique, PLC.HasUnique tyname PLC.TypeUnique) + => VarsInfo tyname name uni a + -> name + -> Prism' (AppContext tyname name uni fun a) (SplitMatchContext tyname name uni fun a) +asNormalDatatypeMatch vinfo name = + prism + reconstructNormalDatatypeMatch + (\args -> case splitNormalDatatypeMatch vinfo name args of + { Just sm -> Right sm; Nothing -> Left args; }) + {- Note [Context splitting in a recursive pass] When writing a recursive pass that processes the whole program, you must be a bit cautious when using a context split. The context split may traverse diff --git a/plutus-core/plutus-ir/src/PlutusIR/Core/Plated.hs b/plutus-core/plutus-ir/src/PlutusIR/Core/Plated.hs index 323b17bab91..7743d17cdd0 100644 --- a/plutus-core/plutus-ir/src/PlutusIR/Core/Plated.hs +++ b/plutus-core/plutus-ir/src/PlutusIR/Core/Plated.hs @@ -27,9 +27,11 @@ module PlutusIR.Core.Plated , termUniques , termUniquesDeep , varDeclSubtypes + , underBinders ) where import PlutusCore qualified as PLC +import PlutusCore.Arity import PlutusCore.Core (tyVarDeclSubkinds, typeSubkinds, typeSubtypes, typeSubtypesDeep, typeUniques, typeUniquesDeep, varDeclSubtypes) import PlutusCore.Flat () @@ -225,3 +227,11 @@ bindingTyNames f = \case TypeBind a d ty -> TypeBind a <$> PLC.tyVarDeclName f d <*> pure ty DatatypeBind a1 d -> DatatypeBind a1 <$> datatypeTyNames f d b@TermBind{} -> pure b + +-- | Focus on the term under the binders corresponding to the given arity. +-- e.g. for arity @[TermParam, TermParam]@ and term @\x y -> t@ it focusses on @t@. +underBinders :: Arity -> Traversal' (Term tyname name uni fun a) (Term tyname name uni fun a) +underBinders [] f t = f t +underBinders (TermParam:arity) f (LamAbs a n ty t) = LamAbs a n ty <$> underBinders arity f t +underBinders (TypeParam:arity) f (TyAbs a ty k t) = TyAbs a ty k <$> underBinders arity f t +underBinders _ _ t = pure t diff --git a/plutus-core/plutus-ir/src/PlutusIR/Purity.hs b/plutus-core/plutus-ir/src/PlutusIR/Purity.hs index 6fc3757afb1..46296c53ddd 100644 --- a/plutus-core/plutus-ir/src/PlutusIR/Purity.hs +++ b/plutus-core/plutus-ir/src/PlutusIR/Purity.hs @@ -126,7 +126,7 @@ termEvaluationOrder :: forall tyname name uni fun a . (ToBuiltinMeaning uni fun, PLC.HasUnique name PLC.TermUnique) => BuiltinsInfo uni fun - -> VarsInfo tyname name + -> VarsInfo tyname name uni a -> Term tyname name uni fun a -> EvalOrder tyname name uni fun a termEvaluationOrder binfo vinfo = goTerm @@ -244,18 +244,19 @@ termEvaluationOrder binfo vinfo = goTerm -> EvalOrder tyname name uni fun a goBuiltinApp a hd args = let - saturated = isSaturated binfo hd args + saturated = saturates args (builtinArityInfo binfo hd) reconstructed = fillAppContext (Builtin a hd) args evalEffect = case saturated of - -- If it's saturated, we might have an effect here - Just True -> evalThis (EvalTerm MaybeImpure MaybeWork reconstructed) + -- If it's saturated or oversaturated, we might have an effect here + Just Saturated -> evalThis (EvalTerm MaybeImpure MaybeWork reconstructed) + Just Oversaturated -> evalThis (EvalTerm MaybeImpure MaybeWork reconstructed) -- TODO: previous definition of work-free included this, it's slightly -- unclear if we should do since we do update partial builtin meanings -- etc. -- If it's unsaturated, we definitely don't, and don't do any work - Just False -> evalThis (EvalTerm Pure WorkFree reconstructed) + Just Undersaturated -> evalThis (EvalTerm Pure WorkFree reconstructed) -- Don't know, be conservative - Nothing -> evalThis (EvalTerm MaybeImpure MaybeWork reconstructed) + Nothing -> evalThis (EvalTerm MaybeImpure MaybeWork reconstructed) in goAppCtx args <> evalEffect goAppCtx :: AppContext tyname name uni fun a -> EvalOrder tyname name uni fun a @@ -271,7 +272,7 @@ termEvaluationOrder binfo vinfo = goTerm isPure :: (ToBuiltinMeaning uni fun, PLC.HasUnique name PLC.TermUnique) => BuiltinsInfo uni fun -> - VarsInfo tyname name -> + VarsInfo tyname name uni a -> Term tyname name uni fun a -> Bool isPure binfo vinfo t = @@ -298,7 +299,7 @@ evaluating this term should do very a trivial amount of work. isWorkFree :: (ToBuiltinMeaning uni fun, PLC.HasUnique name PLC.TermUnique) => BuiltinsInfo uni fun -> - VarsInfo tyname name -> + VarsInfo tyname name uni a -> Term tyname name uni fun a -> Bool isWorkFree binfo vinfo t = diff --git a/plutus-core/plutus-ir/src/PlutusIR/Transform/CaseOfCase.hs b/plutus-core/plutus-ir/src/PlutusIR/Transform/CaseOfCase.hs new file mode 100644 index 00000000000..fc365e2847b --- /dev/null +++ b/plutus-core/plutus-ir/src/PlutusIR/Transform/CaseOfCase.hs @@ -0,0 +1,288 @@ +-- editorconfig-checker-disable-file +{-# LANGUAGE ImpredicativeTypes #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE ViewPatterns #-} +module PlutusIR.Transform.CaseOfCase where + +import Control.Lens hiding (Strict, cons) +import Control.Monad.Trans (lift) +import Control.Monad.Trans.Maybe +import Data.Maybe +import PlutusCore qualified as PLC +import PlutusCore.Arity +import PlutusCore.Name qualified as PLC +import PlutusCore.Quote +import PlutusIR +import PlutusIR.Analysis.Builtins +import PlutusIR.Analysis.VarInfo +import PlutusIR.Contexts +import PlutusIR.Core +import PlutusIR.MkPir +import PlutusIR.Transform.Rename () +import PlutusPrelude + +{-| +Perform the case-of-case transformation. This pushes +case expressions into the case branches of other case +expressions, which can often yield optimization opportunities. + +Example: +@ + case (case s of { C1 a -> x; C2 b -> y; }) of + D1 -> w + D2 -> z + + --> + + case s of + C1 a -> case x of { D1 -> w; D2 -> z; } + C2 b -> case y of { D1 -> w; D2 -> z; } +@ +-} +caseOfCase :: + forall m tyname uni fun a. + ( Ord fun, PLC.HasUnique tyname PLC.TypeUnique + , PLC.MonadQuote m + ) => + BuiltinsInfo uni fun -> + Bool -> + a -> + Term tyname Name uni fun a -> + m (Term tyname Name uni fun a) +-- See Note [Case-of-case and conapps] +caseOfCase binfo conservative newAnn t0 = do + -- We are going to record information about variables in a global map, so we + -- need global uniqueness + t <- PLC.rename t0 + let vinfo = termVarInfo t + liftQuote $ transformMOf termSubterms (processTerm binfo vinfo conservative newAnn) t + +processTerm :: + forall tyname uni fun a . + (Ord fun, PLC.HasUnique tyname PLC.TypeUnique) => + BuiltinsInfo uni fun -> + VarsInfo tyname Name uni a -> + Bool -> + a -> + Term tyname Name uni fun a -> + Quote (Term tyname Name uni fun a) +processTerm binfo vinfo conservative newAnn t + -- We have a saturated datatype matcher application + | Just (smcO@(SplitMatchContext _ (outerScrut, _, _) _ _), reconstructOuter, _) <- splitMatch binfo vinfo t + -- The scrutinee is itself an application + , Just (smcI, reconstructInner, innerBranchArities) <- splitMatch binfo vinfo outerScrut + = do + nt <- runMaybeT $ tryDoCaseOfCase vinfo conservative newAnn (smcO, reconstructOuter) (smcI, reconstructInner) innerBranchArities + case nt of + Just newTerm -> pure newTerm + Nothing -> pure t + | otherwise = pure t + +tryDoCaseOfCase :: + VarsInfo tyname Name uni a + -> Bool + -> a + -> (SplitMatchContext tyname Name uni fun a, SplitMatchContext tyname Name uni fun a -> Term tyname Name uni fun a) + -> (SplitMatchContext tyname Name uni fun a, SplitMatchContext tyname Name uni fun a -> Term tyname Name uni fun a) + -> [Arity] + -> MaybeT Quote (Term tyname Name uni fun a) +tryDoCaseOfCase + vinfo + conservative + newAnn + (SplitMatchContext outerVars (_, outerScrutTy, outerScrutAnn) (outerResTy, outerResTyAnn) outerBranches, reconstructOuter) + -- Note: we don't use the inner result type, we're going to replace it + (SplitMatchContext innerVars (innerScrut, innerScrutTy, innerScrutAnn) _ innerBranches, reconstructInner) + innerBranchArities + = do + kName <- lift $ freshName "k_caseOfCase" + sName <- lift $ freshName "scrutinee" + let + -- If a term is a constructor application, returns the name of the constructor + conAppHead (splitApplication -> (Var _ n, _)) | Just (DatatypeConstructor{}) <- lookupVarInfo n vinfo = Just n + conAppHead _ = Nothing + -- Gets all the constructor application heads from inside the branches of the inner match + innerBranchConAppHeads = mapMaybe conAppHead $ innerBranches ^.. underBranches innerBranchArities + -- Check whether a) all the branches are conapps, and b) all the conapps are distinct. + -- See Note [Case-of-case and conapps] + allDistinctBranchConApps = + let + -- Otherwise we've lost something when we did the traversal and we don't know what's going on + lengthsMatch = length innerBranchConAppHeads == length innerBranchArities + distinctCons = distinct innerBranchConAppHeads + in lengthsMatch && distinctCons + -- If we're being conservative (so trying to avoid code growth), and we don't know that the inlined + -- version will reduce, then bind the outer case to a function to avoid code growth + bindOuterCase = conservative && not allDistinctBranchConApps + + let + mkNewOuterMatch newScrut = + reconstructOuter $ SplitMatchContext outerVars (newScrut, outerScrutTy, outerScrutAnn) (outerResTy, outerResTyAnn) outerBranches + -- \(x :: scrutTy) -> case x of ... + newOuterMatchFn = LamAbs newAnn sName (newAnn <$ outerScrutTy) $ mkNewOuterMatch (Var newAnn sName) + -- k_caseOfCase :: scrutTy -> outerResTy = ... + newOuterMatchFnBinding = + TermBind newAnn Strict (VarDecl newAnn kName (TyFun newAnn (newAnn <$ outerScrutTy) outerResTy)) newOuterMatchFn + mkNewInnerBranchBody scrut = + if bindOuterCase + -- k_caseOfCase scrut + then Apply newAnn (Var newAnn kName) scrut + -- case scrut of ... + else mkNewOuterMatch scrut + + newInnerBranches <- MaybeT $ pure $ mapBranches mkNewInnerBranchBody innerBranches innerBranchArities + + let + newInnerMatch = + reconstructInner $ SplitMatchContext innerVars (innerScrut, innerScrutTy, innerScrutAnn) (outerResTy, outerResTyAnn) newInnerBranches + + pure $ + if bindOuterCase + then mkLet newAnn NonRec [newOuterMatchFnBinding] newInnerMatch + else newInnerMatch + +-- | Apply the given function to the term "inside" the case branches in the given 'AppContext'. +-- Must be given an arity for each branch so it knows how many binders to go under. +mapBranches :: + forall tyname name uni fun a + . (Term tyname name uni fun a -> Term tyname name uni fun a) + -> AppContext tyname name uni fun a + -> [Arity] + -> Maybe (AppContext tyname name uni fun a) +mapBranches f = go + where + go :: AppContext tyname name uni fun a -> [Arity] -> Maybe (AppContext tyname name uni fun a) + go AppContextEnd [] = Just AppContextEnd + go (TermAppContext branch ann ctx) (arity:arities) = + -- This makes the whole thing return Nothing if the traversal has no targets, i.e. if the + -- arity doesn't match the term we're looking at. I can't see a way to do this with a more + -- general traversal, so there's some duplication between this and the simpler 'underBranches'. + TermAppContext <$> failover (underBinders arity) f branch <*> pure ann <*> go ctx arities + go _ _ = Nothing + +-- | Traverses under the branches in the application context. +underBranches :: [Arity] -> Traversal' (AppContext tyname name uni fun a) (Term tyname name uni fun a) +underBranches as f = go as + where + go [] AppContextEnd = pure AppContextEnd + go (arity:arities) (TermAppContext branch ann ctx) = + TermAppContext <$> underBinders arity f branch <*> pure ann <*> go arities ctx + go _ ctx = pure ctx + +-- | Split a match, either a normal datatype match or a builtin 'match'. +splitMatch :: forall tyname name uni fun a . (Ord fun, PLC.HasUnique name PLC.TermUnique, PLC.HasUnique tyname PLC.TypeUnique) => + BuiltinsInfo uni fun + -> VarsInfo tyname name uni a + -> Term tyname name uni fun a + -> Maybe (SplitMatchContext tyname name uni fun a, SplitMatchContext tyname name uni fun a -> Term tyname name uni fun a, [Arity]) +splitMatch binfo vinfo t = do + let (hd, args) = splitApplication t + (p, arities) <- case hd of + (Var _ matcherName) -> do + let p = asNormalDatatypeMatch vinfo matcherName + info <- lookupVarInfo matcherName vinfo + constrArities <- case info of + DatatypeMatcher parentTyName -> getConstructorArities parentTyName vinfo + _ -> Nothing + -- The branch arities don't include the type arguments for the constructor + let branchArities = fmap (dropWhile ((==) TypeParam)) constrArities + pure (p, branchArities) + (Builtin _ matcherName) -> do + p <- asBuiltinDatatypeMatch binfo matcherName + branchArities <- builtinDatatypeMatchBranchArities binfo matcherName + pure (p, branchArities) + _ -> Nothing + withPrism p $ \reconstruct match -> + case match args of + Right sm -> + -- wrangle the reconstruction function so it also puts the head back in, for + -- convenience of use elsewhere + pure (sm, \sm' -> fillAppContext hd (reconstruct sm'), arities) + Left _ -> Nothing + +{- Note [Case-of-case and conapps] +Case-of-case is especially good if the bodies of the branches are all constructor applications. +Consider the following program we might typically get from Plutus Tx: + +Bool_match {integer} (ifThenElse {Bool} (lessThanInteger 1 2) True False) 3 4 +---> case-of-case +ifThenElse {integer} (lessThanInteger 1 2) (Bool_match {integer} True 3) (Bool_match {integer} False 4) +---> case-of-known-constructor +ifThenElse {integer} (lessThanInteger 1 2) 3 + +That is, this guarantees that case-of-known constructor will fire and get rid of one of the +matches entirely, which is great. + +In order to be sure that it's definitely good, however, we need all of the branches to +be _distinct_ constructor applications, otherwise we can duplicate code, see +Note [Case-of-case and duplicating code]. +-} + +{- Note [Case-of-case and duplicating code] +Case-of-case can duplicate code. + +Consider this schematic example: + +case (case s of { C1 a -> x; C2 b -> y; }) of + D1 -> w + D2 -> z + +--> + +case s of + C1 a -> case x of { D1 -> w; D2 -> z; } + C2 b -> case y of { D1 -> w; D2 -> z; } + +We duplicate the outer case (the matcher application, importantly including +the branches) for every branch of the inner case. + +Any time we duplicate code we run the risk of exponential program growth, +since we might apply case-of-case inside the duplicated parts of the +program, thus leading to multiplicative growth. In particular, since we apply +case-of-case in a bottom-up fashion, we can apply it inside a subterm (creating +duplication), and then in the main term (multiplying the duplication) in a single +pass. This is not _too_ bad so long as case-of-known-constructor will clear +things up afterwards, but is something to be aware of. + +If the inner branch bodies are conapps (see Note [Case-of-case and conapps]) then +that will reduce but not necessarily eliminate the duplication. Consider + +case (case s of { C1 a -> True; C2 b -> True; C3 c -> False }) of + True -> v + False -> w + +--> (case-of-case) + +case s of + C1 a -> case True of { True -> v; False -> w; } + C2 b -> case True of { True -> v; False -> w; } + C3 c -> case False of { True -> v; False -> w; } + +--> (case-of-known-constructor) + +case s of + C1 a -> v + C2 b -> v + C3 c -> w + +i.e. we still duplicate v! If however the conapps are all distinct constructors then +this won't happen. + +We can mitigate the problem by binding the potentially-duplicated code to a variable +instead: + +case (case s of { C1 a -> x; C2 b -> y; }) of + D1 -> w + D2 -> z + +--> + +let k_caseOfCase = \x -> case x of { D1 -> w; D2 -> z; } +in case s of + C1 a -> k_caseOfCase x + C2 b -> k_caseOfCase y + +This avoids the code growth but is less good as an optimization, unless we can rely +on the inliner to see these as good inlining opportunities, which we currently can't. +-} diff --git a/plutus-core/plutus-ir/src/PlutusIR/Transform/DeadCode.hs b/plutus-core/plutus-ir/src/PlutusIR/Transform/DeadCode.hs index d8625da4a5e..27f80a10349 100644 --- a/plutus-core/plutus-ir/src/PlutusIR/Transform/DeadCode.hs +++ b/plutus-core/plutus-ir/src/PlutusIR/Transform/DeadCode.hs @@ -48,7 +48,7 @@ calculateLiveness :: (PLC.HasUnique name PLC.TermUnique, PLC.HasUnique tyname PLC.TypeUnique, PLC.ToBuiltinMeaning uni fun) => BuiltinsInfo uni fun - -> VarsInfo tyname name + -> VarsInfo tyname name uni a -> Term tyname name uni fun a -> Liveness calculateLiveness binfo vinfo t = diff --git a/plutus-core/plutus-ir/src/PlutusIR/Transform/Inline/Utils.hs b/plutus-core/plutus-ir/src/PlutusIR/Transform/Inline/Utils.hs index bf0c6e2c9d1..06c16c1af45 100644 --- a/plutus-core/plutus-ir/src/PlutusIR/Transform/Inline/Utils.hs +++ b/plutus-core/plutus-ir/src/PlutusIR/Transform/Inline/Utils.hs @@ -55,7 +55,7 @@ type InliningConstraints tyname name uni fun = -- -- See [Inlining and global uniqueness] for caveats about this information. data InlineInfo tyname name uni fun ann = InlineInfo - { _iiVarInfo :: VarInfo.VarsInfo tyname name + { _iiVarInfo :: VarInfo.VarsInfo tyname name uni ann -- ^ Is it strict? Only needed for PIR, not UPLC , _iiUsages :: Usages.Usages -- ^ how many times is it used? diff --git a/plutus-core/plutus-ir/src/PlutusIR/Transform/KnownCon.hs b/plutus-core/plutus-ir/src/PlutusIR/Transform/KnownCon.hs index 16729a4303a..d2a8d931f6d 100644 --- a/plutus-core/plutus-ir/src/PlutusIR/Transform/KnownCon.hs +++ b/plutus-core/plutus-ir/src/PlutusIR/Transform/KnownCon.hs @@ -53,21 +53,21 @@ processTerm :: (Eq name , PLC.HasUnique name PLC.TermUnique , PLC.HasUnique tyname PLC.TypeUnique) => - VarsInfo tyname name -> + VarsInfo tyname name uni a -> Term tyname name uni fun a -> Term tyname name uni fun a processTerm vinfo t | (Var _ n, args) <- splitApplication t - , Just (DatatypeMatcher _ parentName) <- lookupVarInfo n vinfo - , Just (DatatypeTyVar numTyVars constructors ) <- lookupTyVarInfo parentName vinfo + , Just (DatatypeMatcher parentName) <- lookupVarInfo n vinfo + , Just (DatatypeTyVar (Datatype _ _ tvs _ constructors) ) <- lookupTyVarInfo parentName vinfo , (TermAppContext scrut _ (TypeAppContext _resTy _ branchArgs)) <- -- The datatype may have some type arguments, we -- aren't interested in them, so we drop them. - dropAppContext numTyVars args + dropAppContext (length tvs) args , -- The scrutinee is itself an application (Var _ con, conArgs) <- splitApplication scrut , -- ... of one of the constructors from the same datatype as the destructor - Just i <- List.findIndex (== con) constructors + Just i <- List.findIndex (== con) (fmap _varDeclName constructors) , -- ... and there is a branch for that constructor in the destructor application (TermAppContext branch _ _) <- dropAppContext i branchArgs , -- This condition ensures the destructor is fully-applied @@ -79,5 +79,5 @@ processTerm vinfo t -- The arguments to the selected branch consists of the arguments -- to the constructor, without the leading type arguments - e.g., -- if the scrutinee is `Just {integer} 1`, we only need the `1`). - (dropAppContext numTyVars conArgs) + (dropAppContext (length tvs) conArgs) | otherwise = t diff --git a/plutus-core/plutus-ir/src/PlutusIR/Transform/LetFloatIn.hs b/plutus-core/plutus-ir/src/PlutusIR/Transform/LetFloatIn.hs index 1bf85eaa71b..bbb31c1115b 100644 --- a/plutus-core/plutus-ir/src/PlutusIR/Transform/LetFloatIn.hs +++ b/plutus-core/plutus-ir/src/PlutusIR/Transform/LetFloatIn.hs @@ -198,7 +198,7 @@ floatTerm binfo relaxed t0 = do where floatTermInner :: Usages.Usages -> - VarsInfo tyname name -> + VarsInfo tyname name uni a -> Term tyname name uni fun a -> Term tyname name uni fun (a, Uniques) floatTermInner usgs vinfo = go @@ -360,7 +360,7 @@ noUniq = fmap (,mempty) floatable :: (PLC.ToBuiltinMeaning uni fun, PLC.HasUnique name PLC.TermUnique) => BuiltinsInfo uni fun - -> VarsInfo tyname name + -> VarsInfo tyname name uni a -> Binding tyname name uni fun a -> Bool floatable binfo vinfo = \case @@ -385,14 +385,14 @@ floatInBinding :: , PLC.ToBuiltinMeaning uni fun ) => BuiltinsInfo uni fun -> - VarsInfo tyname name -> + VarsInfo tyname name uni a -> -- | Annotation to be attached to the constructed `Let`. a -> Binding tyname name uni fun (a, Uniques) -> Term tyname name uni fun (a, Uniques) -> Reader FloatInContext (Term tyname name uni fun (a, Uniques)) floatInBinding binfo vinfo letAnn = \b -> - if floatable binfo vinfo b + if floatable binfo vinfo (fmap fst b) then go b else \body -> let us = termUniqs body <> bindingUniqs b diff --git a/plutus-core/plutus-ir/src/PlutusIR/Transform/LetFloatOut.hs b/plutus-core/plutus-ir/src/PlutusIR/Transform/LetFloatOut.hs index a2d324620ee..4ec809d7fc2 100644 --- a/plutus-core/plutus-ir/src/PlutusIR/Transform/LetFloatOut.hs +++ b/plutus-core/plutus-ir/src/PlutusIR/Transform/LetFloatOut.hs @@ -154,11 +154,11 @@ representativeBindingUnique = type Scope = M.Map PLC.Unique Pos -- | The first pass has a reader context of current depth, and (term&type)variables in scope. -data MarkCtx tyname name uni fun = MarkCtx +data MarkCtx tyname name uni fun a = MarkCtx { _markCtxDepth :: Depth , _markCtxScope :: Scope , _markBuiltinsInfo :: BuiltinsInfo uni fun - , _markVarsInfo :: VarsInfo tyname name + , _markVarsInfo :: VarsInfo tyname name uni a } makeLenses ''MarkCtx @@ -204,7 +204,7 @@ mark :: forall tyname name uni fun a. -> Marks mark binfo tm = snd $ runWriter $ flip runReaderT (MarkCtx topDepth mempty binfo (termVarInfo tm)) $ go tm where - go :: Term tyname name uni fun a -> ReaderT (MarkCtx tyname name uni fun) (Writer Marks) () + go :: Term tyname name uni fun a -> ReaderT (MarkCtx tyname name uni fun a) (Writer Marks) () go = breakNonRec >>> \case -- lam/Lam are treated the same. LamAbs _ n _ tBody -> withLam n $ go tBody @@ -408,11 +408,11 @@ floatTerm binfo t = maxPos :: M.Map k Pos -> Pos maxPos = foldr max topPos -withDepth :: (r ~ MarkCtx tyname name uni fun, MonadReader r m) +withDepth :: (r ~ MarkCtx tyname name uni fun a2, MonadReader r m) => (Depth -> Depth) -> m a -> m a withDepth = local . over markCtxDepth -withLam :: (r ~ MarkCtx tyname name uni fun, MonadReader r m, PLC.HasUnique name unique) +withLam :: (r ~ MarkCtx tyname name uni fun a2, MonadReader r m, PLC.HasUnique name unique) => name -> m a -> m a withLam (view PLC.theUnique -> u) = local $ \ (MarkCtx d scope binfo vinfo) -> @@ -420,7 +420,7 @@ withLam (view PLC.theUnique -> u) = local $ \ (MarkCtx d scope binfo vinfo) -> pos' = Pos d' u LamBody in MarkCtx d' (M.insert u pos' scope) binfo vinfo -withAbs :: (r ~ MarkCtx tyname name uni fun, MonadReader r m, PLC.HasUnique tyname unique) +withAbs :: (r ~ MarkCtx tyname name uni fun a2, MonadReader r m, PLC.HasUnique tyname unique) => tyname -> m a -> m a withAbs (view PLC.theUnique -> u) = local $ \ (MarkCtx d scope binfo vinfo) -> @@ -428,7 +428,7 @@ withAbs (view PLC.theUnique -> u) = local $ \ (MarkCtx d scope binfo vinfo) -> pos' = Pos d' u LamBody in MarkCtx d' (M.insert u pos' scope) binfo vinfo -withBs :: (r ~ MarkCtx tyname name uni fun, MonadReader r m, PLC.HasUnique name PLC.TermUnique, PLC.HasUnique tyname PLC.TypeUnique) +withBs :: (r ~ MarkCtx tyname name uni fun a2, MonadReader r m, PLC.HasUnique name PLC.TermUnique, PLC.HasUnique tyname PLC.TypeUnique) => NE.NonEmpty (Binding tyname name uni fun a3) -> Pos -> m a -> m a @@ -442,7 +442,7 @@ ifRec r f a = case r of NonRec -> a floatable - :: (MonadReader (MarkCtx tyname name uni fun) m, PLC.ToBuiltinMeaning uni fun, PLC.HasUnique name PLC.TermUnique) + :: (MonadReader (MarkCtx tyname name uni fun a) m, PLC.ToBuiltinMeaning uni fun, PLC.HasUnique name PLC.TermUnique) => BindingGrp tyname name uni fun a -> m Bool floatable (BindingGrp _ _ bs) = do @@ -461,7 +461,7 @@ An extreme alternative implementation is to treat *all strict* bindings as unflo hasNoEffects :: (PLC.ToBuiltinMeaning uni fun, PLC.HasUnique name PLC.TermUnique) => BuiltinsInfo uni fun - -> VarsInfo tyname name + -> VarsInfo tyname name uni a -> Binding tyname name uni fun a -> Bool hasNoEffects binfo vinfo = \case TypeBind{} -> True diff --git a/plutus-core/plutus-ir/src/PlutusIR/Transform/StrictifyBindings.hs b/plutus-core/plutus-ir/src/PlutusIR/Transform/StrictifyBindings.hs index ada167d0180..05f2e125fb0 100644 --- a/plutus-core/plutus-ir/src/PlutusIR/Transform/StrictifyBindings.hs +++ b/plutus-core/plutus-ir/src/PlutusIR/Transform/StrictifyBindings.hs @@ -18,7 +18,7 @@ import PlutusIR.Analysis.VarInfo strictifyBindingsStep :: (ToBuiltinMeaning uni fun, PLC.HasUnique name PLC.TermUnique) => BuiltinsInfo uni fun - -> VarsInfo tyname name + -> VarsInfo tyname name uni a -> Term tyname name uni fun a -> Term tyname name uni fun a strictifyBindingsStep binfo vinfo = \case diff --git a/plutus-core/plutus-ir/src/PlutusIR/Transform/ThunkRecursions.hs b/plutus-core/plutus-ir/src/PlutusIR/Transform/ThunkRecursions.hs index c52961ca422..1e88ee52084 100644 --- a/plutus-core/plutus-ir/src/PlutusIR/Transform/ThunkRecursions.hs +++ b/plutus-core/plutus-ir/src/PlutusIR/Transform/ThunkRecursions.hs @@ -124,7 +124,7 @@ thunkRecursionsStep :: forall tyname name uni fun a . (ToBuiltinMeaning uni fun, PLC.HasUnique name PLC.TermUnique) => BuiltinsInfo uni fun - -> VarsInfo tyname name + -> VarsInfo tyname name uni a -> Term tyname name uni fun a -> Term tyname name uni fun a thunkRecursionsStep binfo vinfo = \case diff --git a/plutus-core/plutus-ir/test/PlutusIR/Compiler/Recursion/factorial.golden b/plutus-core/plutus-ir/test/PlutusIR/Compiler/Recursion/factorial.golden index 47c04489204..c9c2ddbfc35 100644 --- a/plutus-core/plutus-ir/test/PlutusIR/Compiler/Recursion/factorial.golden +++ b/plutus-core/plutus-ir/test/PlutusIR/Compiler/Recursion/factorial.golden @@ -2,30 +2,30 @@ 1.1.0 [ [ - (lam s_545 [ s_545 s_545 ]) + (lam s_800 [ s_800 s_800 ]) (lam - s_546 + s_801 (lam - x_547 + x_802 [ (lam - factorial_548 + factorial_803 [ [ [ [ (force (builtin ifThenElse)) - [ [ (builtin equalsInteger) (con integer 0) ] x_547 ] + [ [ (builtin equalsInteger) (con integer 0) ] x_802 ] ] - (lam u_549 (con integer 1)) + (lam u_804 (con integer 1)) ] (lam - u_550 + u_805 [ - [ (builtin multiplyInteger) x_547 ] + [ (builtin multiplyInteger) x_802 ] [ - factorial_548 - [ [ (builtin subtractInteger) x_547 ] (con integer 1) ] + factorial_803 + [ [ (builtin subtractInteger) x_802 ] (con integer 1) ] ] ] ) @@ -33,7 +33,7 @@ (con unit ()) ] ) - [ s_546 s_546 ] + [ s_801 s_801 ] ] ) ) diff --git a/plutus-core/plutus-ir/test/PlutusIR/Transform/CaseOfCase/Tests.hs b/plutus-core/plutus-ir/test/PlutusIR/Transform/CaseOfCase/Tests.hs new file mode 100644 index 00000000000..0ba272f1d63 --- /dev/null +++ b/plutus-core/plutus-ir/test/PlutusIR/Transform/CaseOfCase/Tests.hs @@ -0,0 +1,34 @@ +{-# LANGUAGE TypeApplications #-} +module PlutusIR.Transform.CaseOfCase.Tests where + +import Test.Tasty +import Test.Tasty.Extras + +import PlutusCore qualified as PLC +import PlutusCore.Name +import PlutusCore.Quote +import PlutusIR.Analysis.Builtins +import PlutusIR.Error as PIR +import PlutusIR.Parser +import PlutusIR.Test +import PlutusIR.Transform.CaseOfCase qualified as CaseOfCase +import PlutusIR.TypeCheck as TC +import PlutusPrelude + +test_caseOfCase :: TestTree +test_caseOfCase = runTestNestedIn ["plutus-ir/test/PlutusIR/Transform"] $ + testNested "CaseOfCase" $ + map + (goldenPirM goldenCoCTC pTerm) + [ "basic" + , "builtinBool" + , "largeExpr" + , "exponential" + ] + where + binfo = def & biMatcherLike .~ defaultUniMatcherLike + goldenCoCTC t = rethrow . asIfThrown @(PIR.Error PLC.DefaultUni PLC.DefaultFun ()) $ do + let newT = runQuote $ CaseOfCase.caseOfCase binfo True mempty t + -- make sure the floated result typechecks + _ <- runQuoteT . flip inferType (() <$ newT) =<< TC.getDefTypeCheckConfig () + pure $ newT diff --git a/plutus-core/plutus-ir/test/PlutusIR/Transform/CaseOfCase/basic b/plutus-core/plutus-ir/test/PlutusIR/Transform/CaseOfCase/basic new file mode 100644 index 00000000000..87d4d721041 --- /dev/null +++ b/plutus-core/plutus-ir/test/PlutusIR/Transform/CaseOfCase/basic @@ -0,0 +1,38 @@ +(let + (nonrec) + (datatypebind + (datatype + (tyvardecl Bool (type)) + match_Bool + (vardecl True Bool) (vardecl False Bool) + ) + ) + (datatypebind + (datatype + (tyvardecl Maybe (fun (type) (type))) + (tyvardecl a (type)) + match_Maybe + (vardecl Nothing [Maybe a]) (vardecl Just (fun a [Maybe a])) + ) + ) + (lam x [Maybe (con integer)] + [ + { + [ + match_Bool + [ + { + [{match_Maybe (con integer)} x] + Bool + } + False + (lam i (con integer) True) + ] + ] + (con integer) + } + (con integer 1) + (con integer 0) + ] + ) +) diff --git a/plutus-core/plutus-ir/test/PlutusIR/Transform/CaseOfCase/basic.golden b/plutus-core/plutus-ir/test/PlutusIR/Transform/CaseOfCase/basic.golden new file mode 100644 index 00000000000..dc2d764ab4f --- /dev/null +++ b/plutus-core/plutus-ir/test/PlutusIR/Transform/CaseOfCase/basic.golden @@ -0,0 +1,40 @@ +(let + (nonrec) + (datatypebind + (datatype + (tyvardecl Bool (type)) + + match_Bool + (vardecl True Bool) (vardecl False Bool) + ) + ) + (datatypebind + (datatype + (tyvardecl Maybe (fun (type) (type))) + (tyvardecl a (type)) + match_Maybe + (vardecl Nothing [ Maybe a ]) (vardecl Just (fun a [ Maybe a ])) + ) + ) + (lam + x + [ Maybe (con integer) ] + [ + [ + { [ { match_Maybe (con integer) } x ] (con integer) } + [ + [ { [ match_Bool False ] (con integer) } (con integer 1) ] + (con integer 0) + ] + ] + (lam + i + (con integer) + [ + [ { [ match_Bool True ] (con integer) } (con integer 1) ] + (con integer 0) + ] + ) + ] + ) +) \ No newline at end of file diff --git a/plutus-core/plutus-ir/test/PlutusIR/Transform/CaseOfCase/builtinBool b/plutus-core/plutus-ir/test/PlutusIR/Transform/CaseOfCase/builtinBool new file mode 100644 index 00000000000..2faac1457ed --- /dev/null +++ b/plutus-core/plutus-ir/test/PlutusIR/Transform/CaseOfCase/builtinBool @@ -0,0 +1,36 @@ +(let + (nonrec) + (datatypebind + (datatype + (tyvardecl Bool (type)) + match_Bool + (vardecl True Bool) (vardecl False Bool) + ) + ) + (datatypebind + (datatype + (tyvardecl Maybe (fun (type) (type))) + (tyvardecl a (type)) + match_Maybe + (vardecl Nothing [Maybe a]) (vardecl Just (fun a [Maybe a])) + ) + ) + (lam x (con bool) + [ + { + [ + match_Bool + [ + {(builtin ifThenElse) Bool} + x + False + True + ] + ] + (con integer) + } + (con integer 1) + (con integer 0) + ] + ) +) diff --git a/plutus-core/plutus-ir/test/PlutusIR/Transform/CaseOfCase/builtinBool.golden b/plutus-core/plutus-ir/test/PlutusIR/Transform/CaseOfCase/builtinBool.golden new file mode 100644 index 00000000000..12f9fadd368 --- /dev/null +++ b/plutus-core/plutus-ir/test/PlutusIR/Transform/CaseOfCase/builtinBool.golden @@ -0,0 +1,36 @@ +(let + (nonrec) + (datatypebind + (datatype + (tyvardecl Bool (type)) + + match_Bool + (vardecl True Bool) (vardecl False Bool) + ) + ) + (datatypebind + (datatype + (tyvardecl Maybe (fun (type) (type))) + (tyvardecl a (type)) + match_Maybe + (vardecl Nothing [ Maybe a ]) (vardecl Just (fun a [ Maybe a ])) + ) + ) + (lam + x + (con bool) + [ + [ + [ { (builtin ifThenElse) (con integer) } x ] + [ + [ { [ match_Bool False ] (con integer) } (con integer 1) ] + (con integer 0) + ] + ] + [ + [ { [ match_Bool True ] (con integer) } (con integer 1) ] + (con integer 0) + ] + ] + ) +) \ No newline at end of file diff --git a/plutus-core/plutus-ir/test/PlutusIR/Transform/CaseOfCase/exponential b/plutus-core/plutus-ir/test/PlutusIR/Transform/CaseOfCase/exponential new file mode 100644 index 00000000000..d8340d97e7a --- /dev/null +++ b/plutus-core/plutus-ir/test/PlutusIR/Transform/CaseOfCase/exponential @@ -0,0 +1,73 @@ +-- we end up with four copies of each of the outer branches! +(let + (nonrec) + (datatypebind + (datatype + (tyvardecl Bool (type)) + match_Bool + (vardecl True Bool) (vardecl False Bool) + ) + ) + (datatypebind + (datatype + (tyvardecl Maybe (fun (type) (type))) + (tyvardecl a (type)) + match_Maybe + (vardecl Nothing [Maybe a]) (vardecl Just (fun a [Maybe a])) + ) + ) + (lam x [Maybe (con integer)] + [ + { + [ + match_Bool + [ + { + [{match_Maybe (con integer)} x] + Bool + } + False + (lam i (con integer) True) + ] + ] + (con integer) + } + [ + { + [ + match_Bool + [ + { + [{match_Maybe (con integer)} x] + Bool + } + False + (lam i (con integer) True) + ] + ] + (con integer) + } + (con integer 1) + (con integer 0) + ] + [ + { + [ + match_Bool + [ + { + [{match_Maybe (con integer)} x] + Bool + } + False + (lam i (con integer) True) + ] + ] + (con integer) + } + (con integer 3) + (con integer 2) + ] + ] + ) +) diff --git a/plutus-core/plutus-ir/test/PlutusIR/Transform/CaseOfCase/exponential.golden b/plutus-core/plutus-ir/test/PlutusIR/Transform/CaseOfCase/exponential.golden new file mode 100644 index 00000000000..46868f1c6a9 --- /dev/null +++ b/plutus-core/plutus-ir/test/PlutusIR/Transform/CaseOfCase/exponential.golden @@ -0,0 +1,110 @@ +(let + (nonrec) + (datatypebind + (datatype + (tyvardecl Bool (type)) + + match_Bool + (vardecl True Bool) (vardecl False Bool) + ) + ) + (datatypebind + (datatype + (tyvardecl Maybe (fun (type) (type))) + (tyvardecl a (type)) + match_Maybe + (vardecl Nothing [ Maybe a ]) (vardecl Just (fun a [ Maybe a ])) + ) + ) + (lam + x + [ Maybe (con integer) ] + [ + [ + { [ { match_Maybe (con integer) } x ] (con integer) } + [ + [ + { [ match_Bool False ] (con integer) } + [ + [ + { [ { match_Maybe (con integer) } x ] (con integer) } + [ + [ { [ match_Bool False ] (con integer) } (con integer 1) ] + (con integer 0) + ] + ] + (lam + i + (con integer) + [ + [ { [ match_Bool True ] (con integer) } (con integer 1) ] + (con integer 0) + ] + ) + ] + ] + [ + [ + { [ { match_Maybe (con integer) } x ] (con integer) } + [ + [ { [ match_Bool False ] (con integer) } (con integer 3) ] + (con integer 2) + ] + ] + (lam + i + (con integer) + [ + [ { [ match_Bool True ] (con integer) } (con integer 3) ] + (con integer 2) + ] + ) + ] + ] + ] + (lam + i + (con integer) + [ + [ + { [ match_Bool True ] (con integer) } + [ + [ + { [ { match_Maybe (con integer) } x ] (con integer) } + [ + [ { [ match_Bool False ] (con integer) } (con integer 1) ] + (con integer 0) + ] + ] + (lam + i + (con integer) + [ + [ { [ match_Bool True ] (con integer) } (con integer 1) ] + (con integer 0) + ] + ) + ] + ] + [ + [ + { [ { match_Maybe (con integer) } x ] (con integer) } + [ + [ { [ match_Bool False ] (con integer) } (con integer 3) ] + (con integer 2) + ] + ] + (lam + i + (con integer) + [ + [ { [ match_Bool True ] (con integer) } (con integer 3) ] + (con integer 2) + ] + ) + ] + ] + ) + ] + ) +) \ No newline at end of file diff --git a/plutus-core/plutus-ir/test/PlutusIR/Transform/CaseOfCase/largeExpr b/plutus-core/plutus-ir/test/PlutusIR/Transform/CaseOfCase/largeExpr new file mode 100644 index 00000000000..a738daa84d3 --- /dev/null +++ b/plutus-core/plutus-ir/test/PlutusIR/Transform/CaseOfCase/largeExpr @@ -0,0 +1,39 @@ +-- One of the branch bodies is now not a conapp, so we shouldn't do case-of-case +(let + (nonrec) + (datatypebind + (datatype + (tyvardecl Bool (type)) + match_Bool + (vardecl True Bool) (vardecl False Bool) + ) + ) + (datatypebind + (datatype + (tyvardecl Maybe (fun (type) (type))) + (tyvardecl a (type)) + match_Maybe + (vardecl Nothing [Maybe a]) (vardecl Just (fun a [Maybe a])) + ) + ) + (lam x [Maybe (con integer)] + [ + { + [ + match_Bool + [ + { + [{match_Maybe (con integer)} x] + Bool + } + [(lam b Bool b) False] + (lam i (con integer) True) + ] + ] + (con integer) + } + (con integer 1) + (con integer 0) + ] + ) +) diff --git a/plutus-core/plutus-ir/test/PlutusIR/Transform/CaseOfCase/largeExpr.golden b/plutus-core/plutus-ir/test/PlutusIR/Transform/CaseOfCase/largeExpr.golden new file mode 100644 index 00000000000..832e50aa1d8 --- /dev/null +++ b/plutus-core/plutus-ir/test/PlutusIR/Transform/CaseOfCase/largeExpr.golden @@ -0,0 +1,45 @@ +(let + (nonrec) + (datatypebind + (datatype + (tyvardecl Bool (type)) + + match_Bool + (vardecl True Bool) (vardecl False Bool) + ) + ) + (datatypebind + (datatype + (tyvardecl Maybe (fun (type) (type))) + (tyvardecl a (type)) + match_Maybe + (vardecl Nothing [ Maybe a ]) (vardecl Just (fun a [ Maybe a ])) + ) + ) + (lam + x + [ Maybe (con integer) ] + (let + (nonrec) + (termbind + (strict) + (vardecl k_caseOfCase (fun Bool (con integer))) + (lam + scrutinee + Bool + [ + [ { [ match_Bool scrutinee ] (con integer) } (con integer 1) ] + (con integer 0) + ] + ) + ) + [ + [ + { [ { match_Maybe (con integer) } x ] (con integer) } + [ k_caseOfCase [ (lam b Bool b) False ] ] + ] + (lam i (con integer) [ k_caseOfCase True ]) + ] + ) + ) +) \ No newline at end of file diff --git a/plutus-core/prelude/PlutusPrelude.hs b/plutus-core/prelude/PlutusPrelude.hs index 5db8fed258e..d031a604c90 100644 --- a/plutus-core/prelude/PlutusPrelude.hs +++ b/plutus-core/prelude/PlutusPrelude.hs @@ -92,6 +92,8 @@ module PlutusPrelude , Default (def) -- * Lists , zipExact + , allSame + , distinct , unsafeFromRight , tryError ) where @@ -257,3 +259,10 @@ timesA = ala Endo . stimes {-# INLINE tryError #-} tryError :: MonadError e m => m a -> m (Either e a) tryError a = (Right <$> a) `catchError` (pure . Left) + +allSame :: Eq a => [a] -> Bool +allSame [] = True +allSame (x:xs) = all (x ==) xs + +distinct :: Eq a => [a] -> Bool +distinct = not . allSame diff --git a/plutus-tx-plugin/src/PlutusTx/Options.hs b/plutus-tx-plugin/src/PlutusTx/Options.hs index 0c0101749f2..1d6c0c0df51 100644 --- a/plutus-tx-plugin/src/PlutusTx/Options.hs +++ b/plutus-tx-plugin/src/PlutusTx/Options.hs @@ -63,6 +63,7 @@ data PluginOptions = PluginOptions , _posCoverageLocation :: Bool , _posCoverageBoolean :: Bool , _posRelaxedFloatin :: Bool + , _posCaseOfCaseConservative :: Bool -- | Whether to try and retain the logging behaviour of the program. , _posPreserveLogging :: Bool , -- Setting to `True` defines `trace` as `\_ a -> a` instead of the builtin version. @@ -163,8 +164,10 @@ pluginOptions = -- similarly, it implies preserving logging [ Implication (== True) posRelaxedFloatin False , Implication (== True) posPreserveLogging True + , Implication (== True) posCaseOfCaseConservative True , Implication (== False) posRelaxedFloatin True , Implication (== False) posPreserveLogging False + , Implication (== False) posCaseOfCaseConservative False ] ) , let k = "context-level" @@ -306,6 +309,7 @@ defaultPluginOptions = , _posCoverageLocation = False , _posCoverageBoolean = False , _posRelaxedFloatin = True + , _posCaseOfCaseConservative = False , _posPreserveLogging = False , _posRemoveTrace = False , _posDumpCompilationTrace = False diff --git a/plutus-tx-plugin/src/PlutusTx/Plugin.hs b/plutus-tx-plugin/src/PlutusTx/Plugin.hs index 0bee0463654..9c3c49c17ec 100644 --- a/plutus-tx-plugin/src/PlutusTx/Plugin.hs +++ b/plutus-tx-plugin/src/PlutusTx/Plugin.hs @@ -79,6 +79,7 @@ import Data.Either.Validation import Data.Map qualified as Map import Data.Set qualified as Set import GHC.Num.Integer qualified +import PlutusIR.Analysis.Builtins import PlutusIR.Compiler.Provenance (noProvenance, original) import Prettyprinter qualified as PP import System.IO (openTempFile) @@ -406,7 +407,7 @@ compileMarkedExpr locStr codeTy origE = do ccBlackholed = mempty, ccCurDef = Nothing, ccModBreaks = modBreaks, - ccBuiltinsInfo = def, + ccBuiltinsInfo = (def & biMatcherLike .~ defaultUniMatcherLike), ccBuiltinCostModel = def, ccDebugTraceOn = _posDumpCompilationTrace opts } @@ -493,6 +494,8 @@ runCompiler moduleName opts expr = do (opts ^. posDoSimplifierStrictifyBindings) & set (PIR.ccOpts . PIR.coInlineHints) hints & set (PIR.ccOpts . PIR.coRelaxedFloatin) (opts ^. posRelaxedFloatin) + & set (PIR.ccOpts . PIR.coCaseOfCaseConservative) + (opts ^. posCaseOfCaseConservative) & set (PIR.ccOpts . PIR.coPreserveLogging) (opts ^. posPreserveLogging) -- We could make this configurable with an option, but: -- 1. The only other choice you can make is new version + Scott encoding, and @@ -502,7 +505,7 @@ runCompiler moduleName opts expr = do (if plcVersion < PLC.plcVersion110 then PIR.ScottEncoding else PIR.SumsOfProducts) -- TODO: ensure the same as the one used in the plugin - & set PIR.ccBuiltinsInfo def + & set PIR.ccBuiltinsInfo (def & biMatcherLike .~ defaultUniMatcherLike) & set PIR.ccBuiltinCostModel def plcOpts = PLC.defaultCompilationOpts & set (PLC.coSimplifyOpts . UPLC.soMaxSimplifierIterations) diff --git a/plutus-tx-plugin/test/Budget/9.2/allCheap.pir.golden b/plutus-tx-plugin/test/Budget/9.2/allCheap.pir.golden index b3641241f20..3e2dd3c6447 100644 --- a/plutus-tx-plugin/test/Budget/9.2/allCheap.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.2/allCheap.pir.golden @@ -18,11 +18,11 @@ letrec (/\dead -> True) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger 1 x) False True) + ifThenElse {all dead. Bool} - (/\dead -> go xs) + (lessThanEqualsInteger 1 x) (/\dead -> False) + (/\dead -> go xs) {all dead. dead}) {all dead. dead} in diff --git a/plutus-tx-plugin/test/Budget/9.2/allEmptyList.pir.golden b/plutus-tx-plugin/test/Budget/9.2/allEmptyList.pir.golden index 465487cc399..710a5d747ff 100644 --- a/plutus-tx-plugin/test/Budget/9.2/allEmptyList.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.2/allEmptyList.pir.golden @@ -18,11 +18,11 @@ letrec (/\dead -> True) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger 1 x) False True) + ifThenElse {all dead. Bool} - (/\dead -> go xs) + (lessThanEqualsInteger 1 x) (/\dead -> False) + (/\dead -> go xs) {all dead. dead}) {all dead. dead} in diff --git a/plutus-tx-plugin/test/Budget/9.2/allExpensive.pir.golden b/plutus-tx-plugin/test/Budget/9.2/allExpensive.pir.golden index e04d471f59a..a43c5736bdb 100644 --- a/plutus-tx-plugin/test/Budget/9.2/allExpensive.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.2/allExpensive.pir.golden @@ -18,11 +18,11 @@ letrec (/\dead -> True) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger 11 x) False True) + ifThenElse {all dead. Bool} - (/\dead -> go xs) + (lessThanEqualsInteger 11 x) (/\dead -> False) + (/\dead -> go xs) {all dead. dead}) {all dead. dead} in diff --git a/plutus-tx-plugin/test/Budget/9.2/anyCheap.pir.golden b/plutus-tx-plugin/test/Budget/9.2/anyCheap.pir.golden index 18b0845a444..0feb5c64a3d 100644 --- a/plutus-tx-plugin/test/Budget/9.2/anyCheap.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.2/anyCheap.pir.golden @@ -18,11 +18,11 @@ letrec (/\dead -> False) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger 10 x) False True) + ifThenElse {all dead. Bool} - (/\dead -> True) + (lessThanEqualsInteger 10 x) (/\dead -> go xs) + (/\dead -> True) {all dead. dead}) {all dead. dead} in diff --git a/plutus-tx-plugin/test/Budget/9.2/anyEmptyList.pir.golden b/plutus-tx-plugin/test/Budget/9.2/anyEmptyList.pir.golden index b476d418c66..ec8ba5d9116 100644 --- a/plutus-tx-plugin/test/Budget/9.2/anyEmptyList.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.2/anyEmptyList.pir.golden @@ -18,11 +18,11 @@ letrec (/\dead -> False) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger 1 x) False True) + ifThenElse {all dead. Bool} - (/\dead -> True) + (lessThanEqualsInteger 1 x) (/\dead -> go xs) + (/\dead -> True) {all dead. dead}) {all dead. dead} in diff --git a/plutus-tx-plugin/test/Budget/9.2/anyExpensive.pir.golden b/plutus-tx-plugin/test/Budget/9.2/anyExpensive.pir.golden index d9c1b3a0257..a5a24c07be7 100644 --- a/plutus-tx-plugin/test/Budget/9.2/anyExpensive.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.2/anyExpensive.pir.golden @@ -18,11 +18,11 @@ letrec (/\dead -> False) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger 1 x) False True) + ifThenElse {all dead. Bool} - (/\dead -> True) + (lessThanEqualsInteger 1 x) (/\dead -> go xs) + (/\dead -> True) {all dead. dead}) {all dead. dead} in diff --git a/plutus-tx-plugin/test/Budget/9.2/constAccL.pir.golden b/plutus-tx-plugin/test/Budget/9.2/constAccL.pir.golden index a1cc5a80c47..f34f07ae56e 100644 --- a/plutus-tx-plugin/test/Budget/9.2/constAccL.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.2/constAccL.pir.golden @@ -14,22 +14,20 @@ letrec (\(x : integer) (xs : List integer) -> /\dead -> go acc xs) {all dead. dead} in -let - data Bool | Bool_match where - True : Bool - False : Bool -in letrec !go : integer -> List integer = \(n : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger n 0) True False) + ifThenElse {all dead. List integer} + (lessThanEqualsInteger n 0) (/\dead -> Nil {integer}) (/\dead -> Cons {integer} 1 (go (subtractInteger n 1))) {all dead. dead} in let + data Bool | Bool_match where + True : Bool + False : Bool !ls : List integer = go 1000 in go 42 ls \ No newline at end of file diff --git a/plutus-tx-plugin/test/Budget/9.2/constAccR.pir.golden b/plutus-tx-plugin/test/Budget/9.2/constAccR.pir.golden index c6123acd46d..619a75b2a6a 100644 --- a/plutus-tx-plugin/test/Budget/9.2/constAccR.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.2/constAccR.pir.golden @@ -14,22 +14,20 @@ letrec (\(x : integer) (xs : List integer) -> /\dead -> go xs) {all dead. dead} in -let - data Bool | Bool_match where - True : Bool - False : Bool -in letrec !go : integer -> List integer = \(n : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger n 0) True False) + ifThenElse {all dead. List integer} + (lessThanEqualsInteger n 0) (/\dead -> Nil {integer}) (/\dead -> Cons {integer} 1 (go (subtractInteger n 1))) {all dead. dead} in let + data Bool | Bool_match where + True : Bool + False : Bool !ls : List integer = go 1000 in go ls \ No newline at end of file diff --git a/plutus-tx-plugin/test/Budget/9.2/constElL.pir.golden b/plutus-tx-plugin/test/Budget/9.2/constElL.pir.golden index 00e07b5f2f0..b89b2214ee3 100644 --- a/plutus-tx-plugin/test/Budget/9.2/constElL.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.2/constElL.pir.golden @@ -14,22 +14,20 @@ letrec (\(x : integer) (xs : List integer) -> /\dead -> go x xs) {all dead. dead} in -let - data Bool | Bool_match where - True : Bool - False : Bool -in letrec !go : integer -> List integer = \(n : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger n 0) True False) + ifThenElse {all dead. List integer} + (lessThanEqualsInteger n 0) (/\dead -> Nil {integer}) (/\dead -> Cons {integer} 1 (go (subtractInteger n 1))) {all dead. dead} in let + data Bool | Bool_match where + True : Bool + False : Bool !ls : List integer = go 1000 in go 42 ls \ No newline at end of file diff --git a/plutus-tx-plugin/test/Budget/9.2/constElR.pir.golden b/plutus-tx-plugin/test/Budget/9.2/constElR.pir.golden index ce7fe4cdd5e..cd7e1fa820d 100644 --- a/plutus-tx-plugin/test/Budget/9.2/constElR.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.2/constElR.pir.golden @@ -15,22 +15,20 @@ letrec /\dead -> let !ds : integer = go xs in x) {all dead. dead} in -let - data Bool | Bool_match where - True : Bool - False : Bool -in letrec !go : integer -> List integer = \(n : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger n 0) True False) + ifThenElse {all dead. List integer} + (lessThanEqualsInteger n 0) (/\dead -> Nil {integer}) (/\dead -> Cons {integer} 1 (go (subtractInteger n 1))) {all dead. dead} in let + data Bool | Bool_match where + True : Bool + False : Bool !ls : List integer = go 1000 in go ls \ No newline at end of file diff --git a/plutus-tx-plugin/test/Budget/9.2/elemCheap.pir.golden b/plutus-tx-plugin/test/Budget/9.2/elemCheap.pir.golden index 9141c23e19e..ea49cc44536 100644 --- a/plutus-tx-plugin/test/Budget/9.2/elemCheap.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.2/elemCheap.pir.golden @@ -18,9 +18,9 @@ letrec (/\dead -> False) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (equalsInteger 1 x) True False) + ifThenElse {all dead. Bool} + (equalsInteger 1 x) (/\dead -> True) (/\dead -> go xs) {all dead. dead}) diff --git a/plutus-tx-plugin/test/Budget/9.2/elemExpensive.pir.golden b/plutus-tx-plugin/test/Budget/9.2/elemExpensive.pir.golden index d056d7efa25..290495ad8f8 100644 --- a/plutus-tx-plugin/test/Budget/9.2/elemExpensive.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.2/elemExpensive.pir.golden @@ -18,9 +18,9 @@ letrec (/\dead -> False) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (equalsInteger 0 x) True False) + ifThenElse {all dead. Bool} + (equalsInteger 0 x) (/\dead -> True) (/\dead -> go xs) {all dead. dead}) diff --git a/plutus-tx-plugin/test/Budget/9.2/filter.pir.golden b/plutus-tx-plugin/test/Budget/9.2/filter.pir.golden index 638425f5f85..a6ff41feb9c 100644 --- a/plutus-tx-plugin/test/Budget/9.2/filter.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.2/filter.pir.golden @@ -1,8 +1,3 @@ -let - data Bool | Bool_match where - True : Bool - False : Bool -in letrec data (List :: * -> *) a | List_match where Nil : List a @@ -21,19 +16,18 @@ letrec let !xs : List integer = go xs in - Bool_match - (ifThenElse - {Bool} - (equalsInteger 0 (modInteger x 2)) - True - False) + ifThenElse {all dead. List integer} + (equalsInteger 0 (modInteger x 2)) (/\dead -> Cons {integer} x xs) (/\dead -> xs) {all dead. dead}) {all dead. dead} in let + data Bool | Bool_match where + True : Bool + False : Bool !ls : List integer = (let a = List integer diff --git a/plutus-tx-plugin/test/Budget/9.2/findCheap.pir.golden b/plutus-tx-plugin/test/Budget/9.2/findCheap.pir.golden index 9d87a45aadf..373a7d9242c 100644 --- a/plutus-tx-plugin/test/Budget/9.2/findCheap.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.2/findCheap.pir.golden @@ -8,11 +8,6 @@ letrec Nil : List a Cons : a -> List a -> List a in -let - data Bool | Bool_match where - True : Bool - False : Bool -in letrec !go : List integer -> Maybe integer = \(ds : List integer) -> @@ -23,15 +18,18 @@ letrec (/\dead -> Nothing {integer}) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger 10 x) False True) + ifThenElse {all dead. Maybe integer} - (/\dead -> Just {integer} x) + (lessThanEqualsInteger 10 x) (/\dead -> go xs) + (/\dead -> Just {integer} x) {all dead. dead}) {all dead. dead} in let + data Bool | Bool_match where + True : Bool + False : Bool !ls : List integer = (let a = List integer diff --git a/plutus-tx-plugin/test/Budget/9.2/findEmptyList.pir.golden b/plutus-tx-plugin/test/Budget/9.2/findEmptyList.pir.golden index 474aec54087..12f094251ce 100644 --- a/plutus-tx-plugin/test/Budget/9.2/findEmptyList.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.2/findEmptyList.pir.golden @@ -8,11 +8,6 @@ letrec Nil : List a Cons : a -> List a -> List a in -let - data Bool | Bool_match where - True : Bool - False : Bool -in letrec !go : List integer -> Maybe integer = \(ds : List integer) -> @@ -23,12 +18,17 @@ letrec (/\dead -> Nothing {integer}) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger 1 x) False True) + ifThenElse {all dead. Maybe integer} - (/\dead -> Just {integer} x) + (lessThanEqualsInteger 1 x) (/\dead -> go xs) + (/\dead -> Just {integer} x) {all dead. dead}) {all dead. dead} in +let + data Bool | Bool_match where + True : Bool + False : Bool +in go (Nil {integer}) \ No newline at end of file diff --git a/plutus-tx-plugin/test/Budget/9.2/findExpensive.pir.golden b/plutus-tx-plugin/test/Budget/9.2/findExpensive.pir.golden index ee55f991b49..53b82f76d87 100644 --- a/plutus-tx-plugin/test/Budget/9.2/findExpensive.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.2/findExpensive.pir.golden @@ -8,11 +8,6 @@ letrec Nil : List a Cons : a -> List a -> List a in -let - data Bool | Bool_match where - True : Bool - False : Bool -in letrec !go : List integer -> Maybe integer = \(ds : List integer) -> @@ -23,15 +18,18 @@ letrec (/\dead -> Nothing {integer}) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger 1 x) False True) + ifThenElse {all dead. Maybe integer} - (/\dead -> Just {integer} x) + (lessThanEqualsInteger 1 x) (/\dead -> go xs) + (/\dead -> Just {integer} x) {all dead. dead}) {all dead. dead} in let + data Bool | Bool_match where + True : Bool + False : Bool !ls : List integer = (let a = List integer diff --git a/plutus-tx-plugin/test/Budget/9.2/findIndexCheap.pir.golden b/plutus-tx-plugin/test/Budget/9.2/findIndexCheap.pir.golden index ebaaee5873e..df651d96ff5 100644 --- a/plutus-tx-plugin/test/Budget/9.2/findIndexCheap.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.2/findIndexCheap.pir.golden @@ -8,11 +8,6 @@ letrec Nil : List a Cons : a -> List a -> List a in -let - data Bool | Bool_match where - True : Bool - False : Bool -in letrec !go : integer -> List integer -> Maybe integer = \(i : integer) (ds : List integer) -> @@ -23,15 +18,18 @@ letrec (/\dead -> Nothing {integer}) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger 10 x) False True) + ifThenElse {all dead. Maybe integer} - (/\dead -> Just {integer} i) + (lessThanEqualsInteger 10 x) (/\dead -> go (addInteger 1 i) xs) + (/\dead -> Just {integer} i) {all dead. dead}) {all dead. dead} in let + data Bool | Bool_match where + True : Bool + False : Bool !ls : List integer = (let a = List integer diff --git a/plutus-tx-plugin/test/Budget/9.2/findIndexEmptyList.pir.golden b/plutus-tx-plugin/test/Budget/9.2/findIndexEmptyList.pir.golden index 58fc0d70537..c8e713897ba 100644 --- a/plutus-tx-plugin/test/Budget/9.2/findIndexEmptyList.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.2/findIndexEmptyList.pir.golden @@ -8,11 +8,6 @@ letrec Nil : List a Cons : a -> List a -> List a in -let - data Bool | Bool_match where - True : Bool - False : Bool -in letrec !go : integer -> List integer -> Maybe integer = \(i : integer) (ds : List integer) -> @@ -23,12 +18,17 @@ letrec (/\dead -> Nothing {integer}) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger 1 x) False True) + ifThenElse {all dead. Maybe integer} - (/\dead -> Just {integer} i) + (lessThanEqualsInteger 1 x) (/\dead -> go (addInteger 1 i) xs) + (/\dead -> Just {integer} i) {all dead. dead}) {all dead. dead} in +let + data Bool | Bool_match where + True : Bool + False : Bool +in go 0 (Nil {integer}) \ No newline at end of file diff --git a/plutus-tx-plugin/test/Budget/9.2/findIndexExpensive.pir.golden b/plutus-tx-plugin/test/Budget/9.2/findIndexExpensive.pir.golden index ea04960549d..859809130d7 100644 --- a/plutus-tx-plugin/test/Budget/9.2/findIndexExpensive.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.2/findIndexExpensive.pir.golden @@ -8,11 +8,6 @@ letrec Nil : List a Cons : a -> List a -> List a in -let - data Bool | Bool_match where - True : Bool - False : Bool -in letrec !go : integer -> List integer -> Maybe integer = \(i : integer) (ds : List integer) -> @@ -23,15 +18,18 @@ letrec (/\dead -> Nothing {integer}) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger 1 x) False True) + ifThenElse {all dead. Maybe integer} - (/\dead -> Just {integer} i) + (lessThanEqualsInteger 1 x) (/\dead -> go (addInteger 1 i) xs) + (/\dead -> Just {integer} i) {all dead. dead}) {all dead. dead} in let + data Bool | Bool_match where + True : Bool + False : Bool !ls : List integer = (let a = List integer diff --git a/plutus-tx-plugin/test/Budget/9.2/gte0.pir.golden b/plutus-tx-plugin/test/Budget/9.2/gte0.pir.golden index ae6fab6255b..5958cbad318 100644 --- a/plutus-tx-plugin/test/Budget/9.2/gte0.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.2/gte0.pir.golden @@ -18,20 +18,20 @@ letrec (/\dead -> True) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (lessThanInteger x 0) False True) + ifThenElse {all dead. Bool} - (/\dead -> go xs) + (lessThanInteger x 0) (/\dead -> False) + (/\dead -> go xs) {all dead. dead}) {all dead. dead} in letrec !go : integer -> List integer = \(n : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger n 0) True False) + ifThenElse {all dead. List integer} + (lessThanEqualsInteger n 0) (/\dead -> Nil {integer}) (/\dead -> Cons {integer} 0 (go (subtractInteger n 1))) {all dead. dead} diff --git a/plutus-tx-plugin/test/Budget/9.2/lte0.pir.golden b/plutus-tx-plugin/test/Budget/9.2/lte0.pir.golden index a4a6d6405d1..bb9f7e60419 100644 --- a/plutus-tx-plugin/test/Budget/9.2/lte0.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.2/lte0.pir.golden @@ -18,9 +18,9 @@ letrec (/\dead -> True) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger x 0) True False) + ifThenElse {all dead. Bool} + (lessThanEqualsInteger x 0) (/\dead -> go xs) (/\dead -> False) {all dead. dead}) @@ -29,9 +29,9 @@ in letrec !go : integer -> List integer = \(n : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger n 0) True False) + ifThenElse {all dead. List integer} + (lessThanEqualsInteger n 0) (/\dead -> Nil {integer}) (/\dead -> Cons {integer} 0 (go (subtractInteger n 1))) {all dead. dead} diff --git a/plutus-tx-plugin/test/Budget/9.2/not-not.pir.golden b/plutus-tx-plugin/test/Budget/9.2/not-not.pir.golden index 9d9f0d13406..2ac1632e85d 100644 --- a/plutus-tx-plugin/test/Budget/9.2/not-not.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.2/not-not.pir.golden @@ -5,9 +5,9 @@ in \(x : integer) -> Bool_match - (Bool_match - (ifThenElse {Bool} (lessThanInteger 0 x) True False) + (ifThenElse {all dead. Bool} + (lessThanInteger 0 x) (/\dead -> False) (/\dead -> True) {all dead. dead}) diff --git a/plutus-tx-plugin/test/Budget/9.2/notElemCheap.pir.golden b/plutus-tx-plugin/test/Budget/9.2/notElemCheap.pir.golden index ed2bf7f4892..bdd5e4cec37 100644 --- a/plutus-tx-plugin/test/Budget/9.2/notElemCheap.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.2/notElemCheap.pir.golden @@ -18,9 +18,9 @@ letrec (/\dead -> True) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (equalsInteger 1 x) True False) + ifThenElse {all dead. Bool} + (equalsInteger 1 x) (/\dead -> False) (/\dead -> go xs) {all dead. dead}) diff --git a/plutus-tx-plugin/test/Budget/9.2/notElemExpensive.pir.golden b/plutus-tx-plugin/test/Budget/9.2/notElemExpensive.pir.golden index 6b8c94a91d8..54f7122473e 100644 --- a/plutus-tx-plugin/test/Budget/9.2/notElemExpensive.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.2/notElemExpensive.pir.golden @@ -18,9 +18,9 @@ letrec (/\dead -> True) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (equalsInteger 0 x) True False) + ifThenElse {all dead. Bool} + (equalsInteger 0 x) (/\dead -> False) (/\dead -> go xs) {all dead. dead}) diff --git a/plutus-tx-plugin/test/Budget/9.2/recursiveGte0.pir.golden b/plutus-tx-plugin/test/Budget/9.2/recursiveGte0.pir.golden index cb0947f7a1e..92c43aa65c4 100644 --- a/plutus-tx-plugin/test/Budget/9.2/recursiveGte0.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.2/recursiveGte0.pir.golden @@ -1,8 +1,3 @@ -let - data Bool | Bool_match where - True : Bool - False : Bool -in letrec data (List :: * -> *) a | List_match where Nil : List a @@ -11,13 +6,18 @@ in letrec !go : integer -> List integer = \(n : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger n 0) True False) + ifThenElse {all dead. List integer} + (lessThanEqualsInteger n 0) (/\dead -> Nil {integer}) (/\dead -> Cons {integer} 0 (go (subtractInteger n 1))) {all dead. dead} in +let + data Bool | Bool_match where + True : Bool + False : Bool +in letrec !recursiveAll : all a. (a -> Bool) -> List a -> Bool = /\a -> diff --git a/plutus-tx-plugin/test/Budget/9.2/recursiveLte0.pir.golden b/plutus-tx-plugin/test/Budget/9.2/recursiveLte0.pir.golden index b2e44075448..c85b1d34584 100644 --- a/plutus-tx-plugin/test/Budget/9.2/recursiveLte0.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.2/recursiveLte0.pir.golden @@ -1,8 +1,3 @@ -let - data Bool | Bool_match where - True : Bool - False : Bool -in letrec data (List :: * -> *) a | List_match where Nil : List a @@ -11,13 +6,18 @@ in letrec !go : integer -> List integer = \(n : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger n 0) True False) + ifThenElse {all dead. List integer} + (lessThanEqualsInteger n 0) (/\dead -> Nil {integer}) (/\dead -> Cons {integer} 0 (go (subtractInteger n 1))) {all dead. dead} in +let + data Bool | Bool_match where + True : Bool + False : Bool +in letrec !recursiveAll : all a. (a -> Bool) -> List a -> Bool = /\a -> diff --git a/plutus-tx-plugin/test/Budget/9.2/show.pir.golden b/plutus-tx-plugin/test/Budget/9.2/show.pir.golden index fc76dc3965a..505836c7520 100644 --- a/plutus-tx-plugin/test/Budget/9.2/show.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.2/show.pir.golden @@ -1,8 +1,5 @@ let !y : integer = 10 - data Bool | Bool_match where - True : Bool - False : Bool in letrec data (List :: * -> *) a | List_match where @@ -15,9 +12,9 @@ letrec let !x : integer = quotientInteger n y in - Bool_match - (ifThenElse {Bool} (equalsInteger 0 x) True False) + ifThenElse {all dead. List integer} + (equalsInteger 0 x) (/\dead -> Cons {integer} (remainderInteger n y) acc) (/\dead -> go (Cons {integer} (remainderInteger n y) acc) x) {all dead. dead} @@ -40,90 +37,58 @@ letrec \(eta : List string) -> Cons {string} - (Bool_match - (ifThenElse {Bool} (equalsInteger 0 x) True False) + (ifThenElse {all dead. string} + (equalsInteger 0 x) (/\dead -> "0") (/\dead -> - Bool_match - (ifThenElse {Bool} (equalsInteger 1 x) True False) + ifThenElse {all dead. string} + (equalsInteger 1 x) (/\dead -> "1") (/\dead -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger 2 x) - True - False) + ifThenElse {all dead. string} + (equalsInteger 2 x) (/\dead -> "2") (/\dead -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger 3 x) - True - False) + ifThenElse {all dead. string} + (equalsInteger 3 x) (/\dead -> "3") (/\dead -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger 4 x) - True - False) + ifThenElse {all dead. string} + (equalsInteger 4 x) (/\dead -> "4") (/\dead -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger 5 x) - True - False) + ifThenElse {all dead. string} + (equalsInteger 5 x) (/\dead -> "5") (/\dead -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger 6 x) - True - False) + ifThenElse {all dead. string} + (equalsInteger 6 x) (/\dead -> "6") (/\dead -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger 7 x) - True - False) + ifThenElse {all dead. string} + (equalsInteger 7 x) (/\dead -> "7") (/\dead -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger - 8 - x) - True - False) + ifThenElse {all dead. string} + (equalsInteger + 8 + x) (/\dead -> "8") (/\dead -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger - 9 - x) - True - False) + ifThenElse {string} + (equalsInteger + 9 + x) "9" "") {all dead. dead}) @@ -142,9 +107,9 @@ letrec !`$fShowBuiltinByteString_$cshowsPrec` : integer -> integer -> List string -> List string = \(p : integer) (n : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanInteger n 0) True False) + ifThenElse {all dead. List string -> List string} + (lessThanInteger n 0) (/\dead -> \(eta : List string) -> Cons @@ -160,54 +125,42 @@ in let !toHex : integer -> List string -> List string = \(x : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger x 9) True False) + ifThenElse {all dead. List string -> List string} + (lessThanEqualsInteger x 9) (/\dead -> `$fShowBuiltinByteString_$cshowsPrec` 0 x) (/\dead -> - Bool_match - (ifThenElse {Bool} (equalsInteger 10 x) True False) + ifThenElse {all dead. List string -> List string} + (equalsInteger 10 x) (/\dead -> \(ds : List string) -> Cons {string} "a" ds) (/\dead -> - Bool_match - (ifThenElse {Bool} (equalsInteger 11 x) True False) + ifThenElse {all dead. List string -> List string} + (equalsInteger 11 x) (/\dead -> \(ds : List string) -> Cons {string} "b" ds) (/\dead -> - Bool_match - (ifThenElse {Bool} (equalsInteger 12 x) True False) + ifThenElse {all dead. List string -> List string} + (equalsInteger 12 x) (/\dead -> \(ds : List string) -> Cons {string} "c" ds) (/\dead -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger 13 x) - True - False) + ifThenElse {all dead. List string -> List string} + (equalsInteger 13 x) (/\dead -> \(ds : List string) -> Cons {string} "d" ds) (/\dead -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger 14 x) - True - False) + ifThenElse {all dead. List string -> List string} + (equalsInteger 14 x) (/\dead -> \(ds : List string) -> Cons {string} "e" ds) (/\dead -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger 15 x) - True - False) + ifThenElse {List string -> List string} + (equalsInteger 15 x) (\(ds : List string) -> Cons {string} "f" ds) (\(ds : List string) -> @@ -248,12 +201,12 @@ in letrec !`$fEnumBool_$cenumFromTo` : integer -> integer -> List integer = \(x : integer) (y : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger x y) False True) + ifThenElse {all dead. List integer} - (/\dead -> Nil {integer}) + (lessThanEqualsInteger x y) (/\dead -> Cons {integer} x (`$fEnumBool_$cenumFromTo` (addInteger 1 x) y)) + (/\dead -> Nil {integer}) {all dead. dead} in let @@ -271,9 +224,9 @@ letrec (/\dead -> Tuple2 {List a} {List a} (Nil {a}) (Nil {a})) (\(y : a) (ys : List a) -> /\dead -> - Bool_match - (ifThenElse {Bool} (equalsInteger 1 ds) True False) + ifThenElse {all dead. Tuple2 (List a) (List a)} + (equalsInteger 1 ds) (/\dead -> Tuple2 {List a} @@ -332,13 +285,9 @@ letrec (let !n : integer = divideInteger (go ds) 2 in - Bool_match - (ifThenElse - {Bool} - (lessThanEqualsInteger n 0) - True - False) + ifThenElse {all dead. Tuple2 (List string) (List string)} + (lessThanEqualsInteger n 0) (/\dead -> Tuple2 {List string} {List string} (Nil {string}) ds) (/\dead -> go {string} n ds) @@ -375,6 +324,9 @@ let (\(v : integer -> a -> List string -> List string) (v : a -> string) -> v) + data Bool | Bool_match where + True : Bool + False : Bool !a : integer = trace {integer} (`$fShowInteger_$cshow` x) x !c : integer = trace @@ -389,11 +341,7 @@ let !d : integer = trace {integer} - (Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger c 0) False True) - {string} - "True" - "False") + (ifThenElse {string} (lessThanEqualsInteger c 0) "False" "True") c !e : integer = trace diff --git a/plutus-tx-plugin/test/Budget/9.2/sumL.pir.golden b/plutus-tx-plugin/test/Budget/9.2/sumL.pir.golden index ea9e4346492..e53c5f906ac 100644 --- a/plutus-tx-plugin/test/Budget/9.2/sumL.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.2/sumL.pir.golden @@ -15,23 +15,21 @@ letrec /\dead -> go (addInteger acc x) xs) {all dead. dead} in -let - data Bool | Bool_match where - True : Bool - False : Bool -in letrec !`$fEnumBool_$cenumFromTo` : integer -> integer -> List integer = \(x : integer) (y : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger x y) False True) + ifThenElse {all dead. List integer} - (/\dead -> Nil {integer}) + (lessThanEqualsInteger x y) (/\dead -> Cons {integer} x (`$fEnumBool_$cenumFromTo` (addInteger 1 x) y)) + (/\dead -> Nil {integer}) {all dead. dead} in let + data Bool | Bool_match where + True : Bool + False : Bool !ls : List integer = `$fEnumBool_$cenumFromTo` 1 1000 in go 0 ls \ No newline at end of file diff --git a/plutus-tx-plugin/test/Budget/9.2/sumR.pir.golden b/plutus-tx-plugin/test/Budget/9.2/sumR.pir.golden index d19de846b79..ed20af8ba80 100644 --- a/plutus-tx-plugin/test/Budget/9.2/sumR.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.2/sumR.pir.golden @@ -14,23 +14,21 @@ letrec (\(x : integer) (xs : List integer) -> /\dead -> addInteger x (go xs)) {all dead. dead} in -let - data Bool | Bool_match where - True : Bool - False : Bool -in letrec !`$fEnumBool_$cenumFromTo` : integer -> integer -> List integer = \(x : integer) (y : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger x y) False True) + ifThenElse {all dead. List integer} - (/\dead -> Nil {integer}) + (lessThanEqualsInteger x y) (/\dead -> Cons {integer} x (`$fEnumBool_$cenumFromTo` (addInteger 1 x) y)) + (/\dead -> Nil {integer}) {all dead. dead} in let + data Bool | Bool_match where + True : Bool + False : Bool !ls : List integer = `$fEnumBool_$cenumFromTo` 1 1000 in go ls \ No newline at end of file diff --git a/plutus-tx-plugin/test/Budget/9.6/allCheap.pir.golden b/plutus-tx-plugin/test/Budget/9.6/allCheap.pir.golden index b3641241f20..3e2dd3c6447 100644 --- a/plutus-tx-plugin/test/Budget/9.6/allCheap.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.6/allCheap.pir.golden @@ -18,11 +18,11 @@ letrec (/\dead -> True) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger 1 x) False True) + ifThenElse {all dead. Bool} - (/\dead -> go xs) + (lessThanEqualsInteger 1 x) (/\dead -> False) + (/\dead -> go xs) {all dead. dead}) {all dead. dead} in diff --git a/plutus-tx-plugin/test/Budget/9.6/allEmptyList.pir.golden b/plutus-tx-plugin/test/Budget/9.6/allEmptyList.pir.golden index 465487cc399..710a5d747ff 100644 --- a/plutus-tx-plugin/test/Budget/9.6/allEmptyList.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.6/allEmptyList.pir.golden @@ -18,11 +18,11 @@ letrec (/\dead -> True) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger 1 x) False True) + ifThenElse {all dead. Bool} - (/\dead -> go xs) + (lessThanEqualsInteger 1 x) (/\dead -> False) + (/\dead -> go xs) {all dead. dead}) {all dead. dead} in diff --git a/plutus-tx-plugin/test/Budget/9.6/allExpensive.pir.golden b/plutus-tx-plugin/test/Budget/9.6/allExpensive.pir.golden index e04d471f59a..a43c5736bdb 100644 --- a/plutus-tx-plugin/test/Budget/9.6/allExpensive.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.6/allExpensive.pir.golden @@ -18,11 +18,11 @@ letrec (/\dead -> True) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger 11 x) False True) + ifThenElse {all dead. Bool} - (/\dead -> go xs) + (lessThanEqualsInteger 11 x) (/\dead -> False) + (/\dead -> go xs) {all dead. dead}) {all dead. dead} in diff --git a/plutus-tx-plugin/test/Budget/9.6/anyCheap.pir.golden b/plutus-tx-plugin/test/Budget/9.6/anyCheap.pir.golden index 18b0845a444..0feb5c64a3d 100644 --- a/plutus-tx-plugin/test/Budget/9.6/anyCheap.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.6/anyCheap.pir.golden @@ -18,11 +18,11 @@ letrec (/\dead -> False) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger 10 x) False True) + ifThenElse {all dead. Bool} - (/\dead -> True) + (lessThanEqualsInteger 10 x) (/\dead -> go xs) + (/\dead -> True) {all dead. dead}) {all dead. dead} in diff --git a/plutus-tx-plugin/test/Budget/9.6/anyEmptyList.pir.golden b/plutus-tx-plugin/test/Budget/9.6/anyEmptyList.pir.golden index b476d418c66..ec8ba5d9116 100644 --- a/plutus-tx-plugin/test/Budget/9.6/anyEmptyList.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.6/anyEmptyList.pir.golden @@ -18,11 +18,11 @@ letrec (/\dead -> False) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger 1 x) False True) + ifThenElse {all dead. Bool} - (/\dead -> True) + (lessThanEqualsInteger 1 x) (/\dead -> go xs) + (/\dead -> True) {all dead. dead}) {all dead. dead} in diff --git a/plutus-tx-plugin/test/Budget/9.6/anyExpensive.pir.golden b/plutus-tx-plugin/test/Budget/9.6/anyExpensive.pir.golden index d9c1b3a0257..a5a24c07be7 100644 --- a/plutus-tx-plugin/test/Budget/9.6/anyExpensive.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.6/anyExpensive.pir.golden @@ -18,11 +18,11 @@ letrec (/\dead -> False) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger 1 x) False True) + ifThenElse {all dead. Bool} - (/\dead -> True) + (lessThanEqualsInteger 1 x) (/\dead -> go xs) + (/\dead -> True) {all dead. dead}) {all dead. dead} in diff --git a/plutus-tx-plugin/test/Budget/9.6/constAccL.pir.golden b/plutus-tx-plugin/test/Budget/9.6/constAccL.pir.golden index a1cc5a80c47..f34f07ae56e 100644 --- a/plutus-tx-plugin/test/Budget/9.6/constAccL.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.6/constAccL.pir.golden @@ -14,22 +14,20 @@ letrec (\(x : integer) (xs : List integer) -> /\dead -> go acc xs) {all dead. dead} in -let - data Bool | Bool_match where - True : Bool - False : Bool -in letrec !go : integer -> List integer = \(n : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger n 0) True False) + ifThenElse {all dead. List integer} + (lessThanEqualsInteger n 0) (/\dead -> Nil {integer}) (/\dead -> Cons {integer} 1 (go (subtractInteger n 1))) {all dead. dead} in let + data Bool | Bool_match where + True : Bool + False : Bool !ls : List integer = go 1000 in go 42 ls \ No newline at end of file diff --git a/plutus-tx-plugin/test/Budget/9.6/constAccR.pir.golden b/plutus-tx-plugin/test/Budget/9.6/constAccR.pir.golden index c6123acd46d..619a75b2a6a 100644 --- a/plutus-tx-plugin/test/Budget/9.6/constAccR.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.6/constAccR.pir.golden @@ -14,22 +14,20 @@ letrec (\(x : integer) (xs : List integer) -> /\dead -> go xs) {all dead. dead} in -let - data Bool | Bool_match where - True : Bool - False : Bool -in letrec !go : integer -> List integer = \(n : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger n 0) True False) + ifThenElse {all dead. List integer} + (lessThanEqualsInteger n 0) (/\dead -> Nil {integer}) (/\dead -> Cons {integer} 1 (go (subtractInteger n 1))) {all dead. dead} in let + data Bool | Bool_match where + True : Bool + False : Bool !ls : List integer = go 1000 in go ls \ No newline at end of file diff --git a/plutus-tx-plugin/test/Budget/9.6/constElL.pir.golden b/plutus-tx-plugin/test/Budget/9.6/constElL.pir.golden index 00e07b5f2f0..b89b2214ee3 100644 --- a/plutus-tx-plugin/test/Budget/9.6/constElL.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.6/constElL.pir.golden @@ -14,22 +14,20 @@ letrec (\(x : integer) (xs : List integer) -> /\dead -> go x xs) {all dead. dead} in -let - data Bool | Bool_match where - True : Bool - False : Bool -in letrec !go : integer -> List integer = \(n : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger n 0) True False) + ifThenElse {all dead. List integer} + (lessThanEqualsInteger n 0) (/\dead -> Nil {integer}) (/\dead -> Cons {integer} 1 (go (subtractInteger n 1))) {all dead. dead} in let + data Bool | Bool_match where + True : Bool + False : Bool !ls : List integer = go 1000 in go 42 ls \ No newline at end of file diff --git a/plutus-tx-plugin/test/Budget/9.6/constElR.pir.golden b/plutus-tx-plugin/test/Budget/9.6/constElR.pir.golden index ce7fe4cdd5e..cd7e1fa820d 100644 --- a/plutus-tx-plugin/test/Budget/9.6/constElR.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.6/constElR.pir.golden @@ -15,22 +15,20 @@ letrec /\dead -> let !ds : integer = go xs in x) {all dead. dead} in -let - data Bool | Bool_match where - True : Bool - False : Bool -in letrec !go : integer -> List integer = \(n : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger n 0) True False) + ifThenElse {all dead. List integer} + (lessThanEqualsInteger n 0) (/\dead -> Nil {integer}) (/\dead -> Cons {integer} 1 (go (subtractInteger n 1))) {all dead. dead} in let + data Bool | Bool_match where + True : Bool + False : Bool !ls : List integer = go 1000 in go ls \ No newline at end of file diff --git a/plutus-tx-plugin/test/Budget/9.6/elemCheap.pir.golden b/plutus-tx-plugin/test/Budget/9.6/elemCheap.pir.golden index 9141c23e19e..ea49cc44536 100644 --- a/plutus-tx-plugin/test/Budget/9.6/elemCheap.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.6/elemCheap.pir.golden @@ -18,9 +18,9 @@ letrec (/\dead -> False) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (equalsInteger 1 x) True False) + ifThenElse {all dead. Bool} + (equalsInteger 1 x) (/\dead -> True) (/\dead -> go xs) {all dead. dead}) diff --git a/plutus-tx-plugin/test/Budget/9.6/elemExpensive.pir.golden b/plutus-tx-plugin/test/Budget/9.6/elemExpensive.pir.golden index d056d7efa25..290495ad8f8 100644 --- a/plutus-tx-plugin/test/Budget/9.6/elemExpensive.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.6/elemExpensive.pir.golden @@ -18,9 +18,9 @@ letrec (/\dead -> False) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (equalsInteger 0 x) True False) + ifThenElse {all dead. Bool} + (equalsInteger 0 x) (/\dead -> True) (/\dead -> go xs) {all dead. dead}) diff --git a/plutus-tx-plugin/test/Budget/9.6/filter.pir.golden b/plutus-tx-plugin/test/Budget/9.6/filter.pir.golden index 638425f5f85..a6ff41feb9c 100644 --- a/plutus-tx-plugin/test/Budget/9.6/filter.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.6/filter.pir.golden @@ -1,8 +1,3 @@ -let - data Bool | Bool_match where - True : Bool - False : Bool -in letrec data (List :: * -> *) a | List_match where Nil : List a @@ -21,19 +16,18 @@ letrec let !xs : List integer = go xs in - Bool_match - (ifThenElse - {Bool} - (equalsInteger 0 (modInteger x 2)) - True - False) + ifThenElse {all dead. List integer} + (equalsInteger 0 (modInteger x 2)) (/\dead -> Cons {integer} x xs) (/\dead -> xs) {all dead. dead}) {all dead. dead} in let + data Bool | Bool_match where + True : Bool + False : Bool !ls : List integer = (let a = List integer diff --git a/plutus-tx-plugin/test/Budget/9.6/findCheap.pir.golden b/plutus-tx-plugin/test/Budget/9.6/findCheap.pir.golden index 4434e6d5856..4dedb64513c 100644 --- a/plutus-tx-plugin/test/Budget/9.6/findCheap.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.6/findCheap.pir.golden @@ -7,9 +7,6 @@ let data (Maybe :: * -> *) a | Maybe_match where Just : a -> Maybe a Nothing : Maybe a - data Bool | Bool_match where - True : Bool - False : Bool in letrec !go : List integer -> Maybe integer @@ -21,15 +18,18 @@ letrec (/\dead -> Nothing {integer}) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger 10 x) False True) + ifThenElse {all dead. Maybe integer} - (/\dead -> Just {integer} x) + (lessThanEqualsInteger 10 x) (/\dead -> go xs) + (/\dead -> Just {integer} x) {all dead. dead}) {all dead. dead} in let + data Bool | Bool_match where + True : Bool + False : Bool !ls : List integer = (let a = List integer diff --git a/plutus-tx-plugin/test/Budget/9.6/findEmptyList.pir.golden b/plutus-tx-plugin/test/Budget/9.6/findEmptyList.pir.golden index e56630b3ddb..4d24f27b211 100644 --- a/plutus-tx-plugin/test/Budget/9.6/findEmptyList.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.6/findEmptyList.pir.golden @@ -7,9 +7,6 @@ let data (Maybe :: * -> *) a | Maybe_match where Just : a -> Maybe a Nothing : Maybe a - data Bool | Bool_match where - True : Bool - False : Bool in letrec !go : List integer -> Maybe integer @@ -21,12 +18,17 @@ letrec (/\dead -> Nothing {integer}) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger 1 x) False True) + ifThenElse {all dead. Maybe integer} - (/\dead -> Just {integer} x) + (lessThanEqualsInteger 1 x) (/\dead -> go xs) + (/\dead -> Just {integer} x) {all dead. dead}) {all dead. dead} in +let + data Bool | Bool_match where + True : Bool + False : Bool +in go (Nil {integer}) \ No newline at end of file diff --git a/plutus-tx-plugin/test/Budget/9.6/findExpensive.pir.golden b/plutus-tx-plugin/test/Budget/9.6/findExpensive.pir.golden index a94f48deade..f1a72dc139f 100644 --- a/plutus-tx-plugin/test/Budget/9.6/findExpensive.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.6/findExpensive.pir.golden @@ -7,9 +7,6 @@ let data (Maybe :: * -> *) a | Maybe_match where Just : a -> Maybe a Nothing : Maybe a - data Bool | Bool_match where - True : Bool - False : Bool in letrec !go : List integer -> Maybe integer @@ -21,15 +18,18 @@ letrec (/\dead -> Nothing {integer}) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger 1 x) False True) + ifThenElse {all dead. Maybe integer} - (/\dead -> Just {integer} x) + (lessThanEqualsInteger 1 x) (/\dead -> go xs) + (/\dead -> Just {integer} x) {all dead. dead}) {all dead. dead} in let + data Bool | Bool_match where + True : Bool + False : Bool !ls : List integer = (let a = List integer diff --git a/plutus-tx-plugin/test/Budget/9.6/findIndexCheap.pir.golden b/plutus-tx-plugin/test/Budget/9.6/findIndexCheap.pir.golden index 2dbcb61f82c..37d9f97d5d4 100644 --- a/plutus-tx-plugin/test/Budget/9.6/findIndexCheap.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.6/findIndexCheap.pir.golden @@ -7,9 +7,6 @@ let data (Maybe :: * -> *) a | Maybe_match where Just : a -> Maybe a Nothing : Maybe a - data Bool | Bool_match where - True : Bool - False : Bool in letrec !go : integer -> List integer -> Maybe integer @@ -21,15 +18,18 @@ letrec (/\dead -> Nothing {integer}) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger 10 x) False True) + ifThenElse {all dead. Maybe integer} - (/\dead -> Just {integer} i) + (lessThanEqualsInteger 10 x) (/\dead -> go (addInteger 1 i) xs) + (/\dead -> Just {integer} i) {all dead. dead}) {all dead. dead} in let + data Bool | Bool_match where + True : Bool + False : Bool !ls : List integer = (let a = List integer diff --git a/plutus-tx-plugin/test/Budget/9.6/findIndexEmptyList.pir.golden b/plutus-tx-plugin/test/Budget/9.6/findIndexEmptyList.pir.golden index cfdedbabc41..60417dfede4 100644 --- a/plutus-tx-plugin/test/Budget/9.6/findIndexEmptyList.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.6/findIndexEmptyList.pir.golden @@ -7,9 +7,6 @@ let data (Maybe :: * -> *) a | Maybe_match where Just : a -> Maybe a Nothing : Maybe a - data Bool | Bool_match where - True : Bool - False : Bool in letrec !go : integer -> List integer -> Maybe integer @@ -21,12 +18,17 @@ letrec (/\dead -> Nothing {integer}) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger 1 x) False True) + ifThenElse {all dead. Maybe integer} - (/\dead -> Just {integer} i) + (lessThanEqualsInteger 1 x) (/\dead -> go (addInteger 1 i) xs) + (/\dead -> Just {integer} i) {all dead. dead}) {all dead. dead} in +let + data Bool | Bool_match where + True : Bool + False : Bool +in go 0 (Nil {integer}) \ No newline at end of file diff --git a/plutus-tx-plugin/test/Budget/9.6/findIndexExpensive.pir.golden b/plutus-tx-plugin/test/Budget/9.6/findIndexExpensive.pir.golden index 5d03400d1a3..d6db198e012 100644 --- a/plutus-tx-plugin/test/Budget/9.6/findIndexExpensive.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.6/findIndexExpensive.pir.golden @@ -7,9 +7,6 @@ let data (Maybe :: * -> *) a | Maybe_match where Just : a -> Maybe a Nothing : Maybe a - data Bool | Bool_match where - True : Bool - False : Bool in letrec !go : integer -> List integer -> Maybe integer @@ -21,15 +18,18 @@ letrec (/\dead -> Nothing {integer}) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger 1 x) False True) + ifThenElse {all dead. Maybe integer} - (/\dead -> Just {integer} i) + (lessThanEqualsInteger 1 x) (/\dead -> go (addInteger 1 i) xs) + (/\dead -> Just {integer} i) {all dead. dead}) {all dead. dead} in let + data Bool | Bool_match where + True : Bool + False : Bool !ls : List integer = (let a = List integer diff --git a/plutus-tx-plugin/test/Budget/9.6/gte0.pir.golden b/plutus-tx-plugin/test/Budget/9.6/gte0.pir.golden index ae6fab6255b..5958cbad318 100644 --- a/plutus-tx-plugin/test/Budget/9.6/gte0.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.6/gte0.pir.golden @@ -18,20 +18,20 @@ letrec (/\dead -> True) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (lessThanInteger x 0) False True) + ifThenElse {all dead. Bool} - (/\dead -> go xs) + (lessThanInteger x 0) (/\dead -> False) + (/\dead -> go xs) {all dead. dead}) {all dead. dead} in letrec !go : integer -> List integer = \(n : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger n 0) True False) + ifThenElse {all dead. List integer} + (lessThanEqualsInteger n 0) (/\dead -> Nil {integer}) (/\dead -> Cons {integer} 0 (go (subtractInteger n 1))) {all dead. dead} diff --git a/plutus-tx-plugin/test/Budget/9.6/lte0.pir.golden b/plutus-tx-plugin/test/Budget/9.6/lte0.pir.golden index a4a6d6405d1..bb9f7e60419 100644 --- a/plutus-tx-plugin/test/Budget/9.6/lte0.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.6/lte0.pir.golden @@ -18,9 +18,9 @@ letrec (/\dead -> True) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger x 0) True False) + ifThenElse {all dead. Bool} + (lessThanEqualsInteger x 0) (/\dead -> go xs) (/\dead -> False) {all dead. dead}) @@ -29,9 +29,9 @@ in letrec !go : integer -> List integer = \(n : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger n 0) True False) + ifThenElse {all dead. List integer} + (lessThanEqualsInteger n 0) (/\dead -> Nil {integer}) (/\dead -> Cons {integer} 0 (go (subtractInteger n 1))) {all dead. dead} diff --git a/plutus-tx-plugin/test/Budget/9.6/not-not.pir.golden b/plutus-tx-plugin/test/Budget/9.6/not-not.pir.golden index 9d9f0d13406..2ac1632e85d 100644 --- a/plutus-tx-plugin/test/Budget/9.6/not-not.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.6/not-not.pir.golden @@ -5,9 +5,9 @@ in \(x : integer) -> Bool_match - (Bool_match - (ifThenElse {Bool} (lessThanInteger 0 x) True False) + (ifThenElse {all dead. Bool} + (lessThanInteger 0 x) (/\dead -> False) (/\dead -> True) {all dead. dead}) diff --git a/plutus-tx-plugin/test/Budget/9.6/notElemCheap.pir.golden b/plutus-tx-plugin/test/Budget/9.6/notElemCheap.pir.golden index ed2bf7f4892..bdd5e4cec37 100644 --- a/plutus-tx-plugin/test/Budget/9.6/notElemCheap.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.6/notElemCheap.pir.golden @@ -18,9 +18,9 @@ letrec (/\dead -> True) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (equalsInteger 1 x) True False) + ifThenElse {all dead. Bool} + (equalsInteger 1 x) (/\dead -> False) (/\dead -> go xs) {all dead. dead}) diff --git a/plutus-tx-plugin/test/Budget/9.6/notElemExpensive.pir.golden b/plutus-tx-plugin/test/Budget/9.6/notElemExpensive.pir.golden index 6b8c94a91d8..54f7122473e 100644 --- a/plutus-tx-plugin/test/Budget/9.6/notElemExpensive.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.6/notElemExpensive.pir.golden @@ -18,9 +18,9 @@ letrec (/\dead -> True) (\(x : integer) (xs : List integer) -> /\dead -> - Bool_match - (ifThenElse {Bool} (equalsInteger 0 x) True False) + ifThenElse {all dead. Bool} + (equalsInteger 0 x) (/\dead -> False) (/\dead -> go xs) {all dead. dead}) diff --git a/plutus-tx-plugin/test/Budget/9.6/recursiveGte0.pir.golden b/plutus-tx-plugin/test/Budget/9.6/recursiveGte0.pir.golden index cb0947f7a1e..92c43aa65c4 100644 --- a/plutus-tx-plugin/test/Budget/9.6/recursiveGte0.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.6/recursiveGte0.pir.golden @@ -1,8 +1,3 @@ -let - data Bool | Bool_match where - True : Bool - False : Bool -in letrec data (List :: * -> *) a | List_match where Nil : List a @@ -11,13 +6,18 @@ in letrec !go : integer -> List integer = \(n : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger n 0) True False) + ifThenElse {all dead. List integer} + (lessThanEqualsInteger n 0) (/\dead -> Nil {integer}) (/\dead -> Cons {integer} 0 (go (subtractInteger n 1))) {all dead. dead} in +let + data Bool | Bool_match where + True : Bool + False : Bool +in letrec !recursiveAll : all a. (a -> Bool) -> List a -> Bool = /\a -> diff --git a/plutus-tx-plugin/test/Budget/9.6/recursiveLte0.pir.golden b/plutus-tx-plugin/test/Budget/9.6/recursiveLte0.pir.golden index b2e44075448..c85b1d34584 100644 --- a/plutus-tx-plugin/test/Budget/9.6/recursiveLte0.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.6/recursiveLte0.pir.golden @@ -1,8 +1,3 @@ -let - data Bool | Bool_match where - True : Bool - False : Bool -in letrec data (List :: * -> *) a | List_match where Nil : List a @@ -11,13 +6,18 @@ in letrec !go : integer -> List integer = \(n : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger n 0) True False) + ifThenElse {all dead. List integer} + (lessThanEqualsInteger n 0) (/\dead -> Nil {integer}) (/\dead -> Cons {integer} 0 (go (subtractInteger n 1))) {all dead. dead} in +let + data Bool | Bool_match where + True : Bool + False : Bool +in letrec !recursiveAll : all a. (a -> Bool) -> List a -> Bool = /\a -> diff --git a/plutus-tx-plugin/test/Budget/9.6/show.pir.golden b/plutus-tx-plugin/test/Budget/9.6/show.pir.golden index bde534e12c5..2b7e8dea2bb 100644 --- a/plutus-tx-plugin/test/Budget/9.6/show.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.6/show.pir.golden @@ -1,8 +1,5 @@ let !y : integer = 10 - data Bool | Bool_match where - True : Bool - False : Bool in letrec data (List :: * -> *) a | List_match where @@ -15,9 +12,9 @@ letrec let !x : integer = quotientInteger n y in - Bool_match - (ifThenElse {Bool} (equalsInteger 0 x) True False) + ifThenElse {all dead. List integer} + (equalsInteger 0 x) (/\dead -> Cons {integer} (remainderInteger n y) acc) (/\dead -> go (Cons {integer} (remainderInteger n y) acc) x) {all dead. dead} @@ -40,90 +37,58 @@ letrec \(eta : List string) -> Cons {string} - (Bool_match - (ifThenElse {Bool} (equalsInteger 0 x) True False) + (ifThenElse {all dead. string} + (equalsInteger 0 x) (/\dead -> "0") (/\dead -> - Bool_match - (ifThenElse {Bool} (equalsInteger 1 x) True False) + ifThenElse {all dead. string} + (equalsInteger 1 x) (/\dead -> "1") (/\dead -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger 2 x) - True - False) + ifThenElse {all dead. string} + (equalsInteger 2 x) (/\dead -> "2") (/\dead -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger 3 x) - True - False) + ifThenElse {all dead. string} + (equalsInteger 3 x) (/\dead -> "3") (/\dead -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger 4 x) - True - False) + ifThenElse {all dead. string} + (equalsInteger 4 x) (/\dead -> "4") (/\dead -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger 5 x) - True - False) + ifThenElse {all dead. string} + (equalsInteger 5 x) (/\dead -> "5") (/\dead -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger 6 x) - True - False) + ifThenElse {all dead. string} + (equalsInteger 6 x) (/\dead -> "6") (/\dead -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger 7 x) - True - False) + ifThenElse {all dead. string} + (equalsInteger 7 x) (/\dead -> "7") (/\dead -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger - 8 - x) - True - False) + ifThenElse {all dead. string} + (equalsInteger + 8 + x) (/\dead -> "8") (/\dead -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger - 9 - x) - True - False) + ifThenElse {string} + (equalsInteger + 9 + x) "9" "") {all dead. dead}) @@ -142,9 +107,9 @@ letrec !`$fShowBuiltinByteString_$cshowsPrec` : integer -> integer -> List string -> List string = \(p : integer) (n : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanInteger n 0) True False) + ifThenElse {all dead. List string -> List string} + (lessThanInteger n 0) (/\dead -> \(eta : List string) -> Cons @@ -160,54 +125,42 @@ in let !toHex : integer -> List string -> List string = \(x : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger x 9) True False) + ifThenElse {all dead. List string -> List string} + (lessThanEqualsInteger x 9) (/\dead -> `$fShowBuiltinByteString_$cshowsPrec` 0 x) (/\dead -> - Bool_match - (ifThenElse {Bool} (equalsInteger 10 x) True False) + ifThenElse {all dead. List string -> List string} + (equalsInteger 10 x) (/\dead -> \(ds : List string) -> Cons {string} "a" ds) (/\dead -> - Bool_match - (ifThenElse {Bool} (equalsInteger 11 x) True False) + ifThenElse {all dead. List string -> List string} + (equalsInteger 11 x) (/\dead -> \(ds : List string) -> Cons {string} "b" ds) (/\dead -> - Bool_match - (ifThenElse {Bool} (equalsInteger 12 x) True False) + ifThenElse {all dead. List string -> List string} + (equalsInteger 12 x) (/\dead -> \(ds : List string) -> Cons {string} "c" ds) (/\dead -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger 13 x) - True - False) + ifThenElse {all dead. List string -> List string} + (equalsInteger 13 x) (/\dead -> \(ds : List string) -> Cons {string} "d" ds) (/\dead -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger 14 x) - True - False) + ifThenElse {all dead. List string -> List string} + (equalsInteger 14 x) (/\dead -> \(ds : List string) -> Cons {string} "e" ds) (/\dead -> - Bool_match - (ifThenElse - {Bool} - (equalsInteger 15 x) - True - False) + ifThenElse {List string -> List string} + (equalsInteger 15 x) (\(ds : List string) -> Cons {string} "f" ds) (\(ds : List string) -> @@ -248,12 +201,12 @@ in letrec !`$fEnumBool_$cenumFromTo` : integer -> integer -> List integer = \(x : integer) (y : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger x y) False True) + ifThenElse {all dead. List integer} - (/\dead -> Nil {integer}) + (lessThanEqualsInteger x y) (/\dead -> Cons {integer} x (`$fEnumBool_$cenumFromTo` (addInteger 1 x) y)) + (/\dead -> Nil {integer}) {all dead. dead} in let @@ -271,9 +224,9 @@ letrec (/\dead -> Tuple2 {List a} {List a} (Nil {a}) (Nil {a})) (\(y : a) (ys : List a) -> /\dead -> - Bool_match - (ifThenElse {Bool} (equalsInteger 1 ds) True False) + ifThenElse {all dead. Tuple2 (List a) (List a)} + (equalsInteger 1 ds) (/\dead -> Tuple2 {List a} @@ -329,13 +282,9 @@ letrec (let !n : integer = divideInteger (go ds) 2 in - Bool_match - (ifThenElse - {Bool} - (lessThanEqualsInteger n 0) - True - False) + ifThenElse {all dead. Tuple2 (List string) (List string)} + (lessThanEqualsInteger n 0) (/\dead -> Tuple2 {List string} {List string} (Nil {string}) ds) (/\dead -> go {string} n ds) @@ -372,6 +321,9 @@ let (\(v : integer -> a -> List string -> List string) (v : a -> string) -> v) + data Bool | Bool_match where + True : Bool + False : Bool !a : integer = trace {integer} (`$fShowInteger_$cshow` x) x !c : integer = trace @@ -386,11 +338,7 @@ let !d : integer = trace {integer} - (Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger c 0) False True) - {string} - "True" - "False") + (ifThenElse {string} (lessThanEqualsInteger c 0) "False" "True") c !e : integer = trace diff --git a/plutus-tx-plugin/test/Budget/9.6/sumL.pir.golden b/plutus-tx-plugin/test/Budget/9.6/sumL.pir.golden index ea9e4346492..e53c5f906ac 100644 --- a/plutus-tx-plugin/test/Budget/9.6/sumL.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.6/sumL.pir.golden @@ -15,23 +15,21 @@ letrec /\dead -> go (addInteger acc x) xs) {all dead. dead} in -let - data Bool | Bool_match where - True : Bool - False : Bool -in letrec !`$fEnumBool_$cenumFromTo` : integer -> integer -> List integer = \(x : integer) (y : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger x y) False True) + ifThenElse {all dead. List integer} - (/\dead -> Nil {integer}) + (lessThanEqualsInteger x y) (/\dead -> Cons {integer} x (`$fEnumBool_$cenumFromTo` (addInteger 1 x) y)) + (/\dead -> Nil {integer}) {all dead. dead} in let + data Bool | Bool_match where + True : Bool + False : Bool !ls : List integer = `$fEnumBool_$cenumFromTo` 1 1000 in go 0 ls \ No newline at end of file diff --git a/plutus-tx-plugin/test/Budget/9.6/sumR.pir.golden b/plutus-tx-plugin/test/Budget/9.6/sumR.pir.golden index d19de846b79..ed20af8ba80 100644 --- a/plutus-tx-plugin/test/Budget/9.6/sumR.pir.golden +++ b/plutus-tx-plugin/test/Budget/9.6/sumR.pir.golden @@ -14,23 +14,21 @@ letrec (\(x : integer) (xs : List integer) -> /\dead -> addInteger x (go xs)) {all dead. dead} in -let - data Bool | Bool_match where - True : Bool - False : Bool -in letrec !`$fEnumBool_$cenumFromTo` : integer -> integer -> List integer = \(x : integer) (y : integer) -> - Bool_match - (ifThenElse {Bool} (lessThanEqualsInteger x y) False True) + ifThenElse {all dead. List integer} - (/\dead -> Nil {integer}) + (lessThanEqualsInteger x y) (/\dead -> Cons {integer} x (`$fEnumBool_$cenumFromTo` (addInteger 1 x) y)) + (/\dead -> Nil {integer}) {all dead. dead} in let + data Bool | Bool_match where + True : Bool + False : Bool !ls : List integer = `$fEnumBool_$cenumFromTo` 1 1000 in go ls \ No newline at end of file diff --git a/plutus-tx-plugin/test/Optimization/9.2/matchAsData.pir.golden b/plutus-tx-plugin/test/Optimization/9.2/matchAsData.pir.golden index 288949a5e25..b893d8b1d0c 100644 --- a/plutus-tx-plugin/test/Optimization/9.2/matchAsData.pir.golden +++ b/plutus-tx-plugin/test/Optimization/9.2/matchAsData.pir.golden @@ -23,9 +23,9 @@ in (unConstrData ds)) {integer} (\(ds : integer) (ds : list data) -> - Bool_match - (ifThenElse {Bool} (equalsInteger 0 ds) True False) + ifThenElse {all dead. integer} + (equalsInteger 0 ds) (/\dead -> unIData (headList {data} ds)) (/\dead -> Tuple2_match @@ -43,9 +43,9 @@ in (unConstrData ds)) {integer} (\(ds : integer) (ds : list data) -> - Bool_match - (ifThenElse {Bool} (equalsInteger 1 ds) True False) + ifThenElse {all dead. integer} + (equalsInteger 1 ds) (/\dead -> 1) (/\dead -> Unit_match (error {Unit}) {integer} (error {integer})) diff --git a/plutus-tx-plugin/test/Optimization/9.6/matchAsData.pir.golden b/plutus-tx-plugin/test/Optimization/9.6/matchAsData.pir.golden index 288949a5e25..b893d8b1d0c 100644 --- a/plutus-tx-plugin/test/Optimization/9.6/matchAsData.pir.golden +++ b/plutus-tx-plugin/test/Optimization/9.6/matchAsData.pir.golden @@ -23,9 +23,9 @@ in (unConstrData ds)) {integer} (\(ds : integer) (ds : list data) -> - Bool_match - (ifThenElse {Bool} (equalsInteger 0 ds) True False) + ifThenElse {all dead. integer} + (equalsInteger 0 ds) (/\dead -> unIData (headList {data} ds)) (/\dead -> Tuple2_match @@ -43,9 +43,9 @@ in (unConstrData ds)) {integer} (\(ds : integer) (ds : list data) -> - Bool_match - (ifThenElse {Bool} (equalsInteger 1 ds) True False) + ifThenElse {all dead. integer} + (equalsInteger 1 ds) (/\dead -> 1) (/\dead -> Unit_match (error {Unit}) {integer} (error {integer})) diff --git a/plutus-tx-plugin/test/Strictness/9.2/let-default.pir.golden b/plutus-tx-plugin/test/Strictness/9.2/let-default.pir.golden index b5c156af3c1..0b153475ff1 100644 --- a/plutus-tx-plugin/test/Strictness/9.2/let-default.pir.golden +++ b/plutus-tx-plugin/test/Strictness/9.2/let-default.pir.golden @@ -9,9 +9,9 @@ in let !n : all t. t = /\t -> error {integer -> t} m in - Bool_match - (ifThenElse {Bool} (lessThanInteger m 0) True False) + ifThenElse {all dead. integer} + (lessThanInteger m 0) (/\dead -> addInteger (n {integer}) (n {integer})) (/\dead -> m) {all dead. dead} \ No newline at end of file diff --git a/plutus-tx-plugin/test/Strictness/9.2/let-nonstrict.pir.golden b/plutus-tx-plugin/test/Strictness/9.2/let-nonstrict.pir.golden index b5c156af3c1..0b153475ff1 100644 --- a/plutus-tx-plugin/test/Strictness/9.2/let-nonstrict.pir.golden +++ b/plutus-tx-plugin/test/Strictness/9.2/let-nonstrict.pir.golden @@ -9,9 +9,9 @@ in let !n : all t. t = /\t -> error {integer -> t} m in - Bool_match - (ifThenElse {Bool} (lessThanInteger m 0) True False) + ifThenElse {all dead. integer} + (lessThanInteger m 0) (/\dead -> addInteger (n {integer}) (n {integer})) (/\dead -> m) {all dead. dead} \ No newline at end of file diff --git a/plutus-tx-plugin/test/Strictness/9.2/let-strict.pir.golden b/plutus-tx-plugin/test/Strictness/9.2/let-strict.pir.golden index b5c156af3c1..0b153475ff1 100644 --- a/plutus-tx-plugin/test/Strictness/9.2/let-strict.pir.golden +++ b/plutus-tx-plugin/test/Strictness/9.2/let-strict.pir.golden @@ -9,9 +9,9 @@ in let !n : all t. t = /\t -> error {integer -> t} m in - Bool_match - (ifThenElse {Bool} (lessThanInteger m 0) True False) + ifThenElse {all dead. integer} + (lessThanInteger m 0) (/\dead -> addInteger (n {integer}) (n {integer})) (/\dead -> m) {all dead. dead} \ No newline at end of file diff --git a/plutus-tx-plugin/test/Strictness/9.6/let-default.pir.golden b/plutus-tx-plugin/test/Strictness/9.6/let-default.pir.golden index b5c156af3c1..0b153475ff1 100644 --- a/plutus-tx-plugin/test/Strictness/9.6/let-default.pir.golden +++ b/plutus-tx-plugin/test/Strictness/9.6/let-default.pir.golden @@ -9,9 +9,9 @@ in let !n : all t. t = /\t -> error {integer -> t} m in - Bool_match - (ifThenElse {Bool} (lessThanInteger m 0) True False) + ifThenElse {all dead. integer} + (lessThanInteger m 0) (/\dead -> addInteger (n {integer}) (n {integer})) (/\dead -> m) {all dead. dead} \ No newline at end of file diff --git a/plutus-tx-plugin/test/Strictness/9.6/let-nonstrict.pir.golden b/plutus-tx-plugin/test/Strictness/9.6/let-nonstrict.pir.golden index b5c156af3c1..0b153475ff1 100644 --- a/plutus-tx-plugin/test/Strictness/9.6/let-nonstrict.pir.golden +++ b/plutus-tx-plugin/test/Strictness/9.6/let-nonstrict.pir.golden @@ -9,9 +9,9 @@ in let !n : all t. t = /\t -> error {integer -> t} m in - Bool_match - (ifThenElse {Bool} (lessThanInteger m 0) True False) + ifThenElse {all dead. integer} + (lessThanInteger m 0) (/\dead -> addInteger (n {integer}) (n {integer})) (/\dead -> m) {all dead. dead} \ No newline at end of file diff --git a/plutus-tx-plugin/test/Strictness/9.6/let-strict.pir.golden b/plutus-tx-plugin/test/Strictness/9.6/let-strict.pir.golden index b5c156af3c1..0b153475ff1 100644 --- a/plutus-tx-plugin/test/Strictness/9.6/let-strict.pir.golden +++ b/plutus-tx-plugin/test/Strictness/9.6/let-strict.pir.golden @@ -9,9 +9,9 @@ in let !n : all t. t = /\t -> error {integer -> t} m in - Bool_match - (ifThenElse {Bool} (lessThanInteger m 0) True False) + ifThenElse {all dead. integer} + (lessThanInteger m 0) (/\dead -> addInteger (n {integer}) (n {integer})) (/\dead -> m) {all dead. dead} \ No newline at end of file diff --git a/plutus-tx-plugin/test/size/max.size.golden b/plutus-tx-plugin/test/size/max.size.golden index dce6588ca14..dc7b54ad014 100644 --- a/plutus-tx-plugin/test/size/max.size.golden +++ b/plutus-tx-plugin/test/size/max.size.golden @@ -1 +1 @@ -36 \ No newline at end of file +33 \ No newline at end of file diff --git a/plutus-tx-plugin/test/size/min.size.golden b/plutus-tx-plugin/test/size/min.size.golden index dce6588ca14..dc7b54ad014 100644 --- a/plutus-tx-plugin/test/size/min.size.golden +++ b/plutus-tx-plugin/test/size/min.size.golden @@ -1 +1 @@ -36 \ No newline at end of file +33 \ No newline at end of file